1 #ifndef CAFFE2_OPERATORS_COPY_OP_H_ 2 #define CAFFE2_OPERATORS_COPY_OP_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/operator.h" 9 template <
class Context,
class DstContext,
class SrcContext>
12 USE_OPERATOR_CONTEXT_FUNCTIONS;
13 USE_SIMPLE_CTOR_DTOR(
CopyOp)
15 bool RunOnDevice()
override {
16 auto& input = this->
template Input<Tensor>(0, SrcContext::GetDeviceType());
18 this->
template Output<Tensor>(0, DstContext::GetDeviceType());
19 output->ResizeLike(input);
20 this->context_.template CopyItems<SrcContext, DstContext>(
24 output->raw_mutable_data(input.dtype()));
29 template <
class Context,
class DstContext,
class SrcContext>
32 template <
class... Args>
39 #endif // CAFFE2_OPERATORS_COPY_OP_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...