1 #include "caffe2/operators/exp_op.h" 10 UnaryElementwiseOp<TensorTypes<float>, CPUContext, ExpFunctor<CPUContext>>);
15 .AllowInplace({{0, 0}})
16 .IdenticalTypeAndShape()
18 Calculates the exponential of the given input tensor ($exp(x)$), element-wise. This 19 operation can be done in an in-place fashion too, by providing the same input 23 - https://github.com/pytorch/pytorch/blob/master/caffe2/operators/exp_op.cc 27 <summary> <b>Example</b> </summary> 33 workspace.ResetWorkspace() 35 op = core.CreateOperator( 41 workspace.FeedBlob("X", (np.random.rand(3,3)).astype(np.float32)) 42 print("X before running op:", workspace.FetchBlob("X")) 43 workspace.RunOperatorOnce(op) 44 print("X after running op:", workspace.FetchBlob("X")) 53 [[0.5821691 0.07719802 0.50159824] 54 [0.40952456 0.36788362 0.84887683] 55 [0.02472685 0.65730894 0.9066397 ]] 57 [[1.7899168 1.080256 1.6513585] 58 [1.5061016 1.4446739 2.3370204] 59 [1.0250351 1.9295927 2.4759884]] 66 .Input(0, "X",
"*(type: Tensor`<float>`)* Input tensor.")
70 "*(type: Tensor`<float>`)* The exponential of the input tensor computed " 77 using GradientMakerBase::GradientMakerBase;
78 std::vector<OperatorDef> GetGradientDefs()
override {
79 return SingleGradientDef(
82 std::vector<std::string>{O(0), GO(0)},
83 std::vector<std::string>{GI(0)});
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...