4 #include "caffe2/core/context.h" 5 #include "caffe2/core/operator.h" 9 template <
class Context>
12 USE_OPERATOR_CONTEXT_FUNCTIONS;
15 bool RunOnDevice()
override {
16 auto& input =
Input(0);
18 auto* output = Output(0, std::vector<int64_t>{}, at::dtype<bool>());
19 *output->template mutable_data<bool>() = (input.numel() == 0);
26 #endif // IS_EMPTY_OP_H_
const Tensor & Input(int idx, DeviceType type=Context::GetDeviceType())
Retrieve a non-owning reference to the input at position 'idx' for this operator. ...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...