1 #ifndef CAFFE2_OPERATORS_CEIL_OP_H_ 2 #define CAFFE2_OPERATORS_CEIL_OP_H_ 4 #include "caffe2/core/common_omp.h" 5 #include "caffe2/core/context.h" 6 #include "caffe2/core/logging.h" 7 #include "caffe2/core/operator.h" 11 template <
typename T,
class Context>
14 USE_OPERATOR_CONTEXT_FUNCTIONS;
15 USE_SIMPLE_CTOR_DTOR(
CeilOp);
17 bool RunOnDevice()
override {
20 auto* Y = Output(0, X.sizes(), at::dtype<float>());
22 const float* Xdata = X.template data<float>();
23 float* Ydata = Y->template mutable_data<float>();
24 for (
int i = 0; i < X.numel(); ++i) {
25 Ydata[i] = std::ceil(Xdata[i]);
33 #endif // CAFFE2_OPERATORS_CEIL_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 ...