4 #include "caffe2/core/context.h" 5 #include "caffe2/core/operator.h" 12 template <
class Context>
15 USE_OPERATOR_CONTEXT_FUNCTIONS;
18 bool RunOnDevice()
override {
19 auto& input = Input(0);
20 auto* output = OperatorBase::Output<Tensor<Context>>(0);
21 output->Resize(input.ndim());
22 TIndex* output_data = output->template mutable_data<TIndex>();
23 context_.template CopyBytes<Context, Context>(
24 input.ndim() *
sizeof(TIndex), input.dims().data(), output_data);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...