1 #include "caffe2/operators/floor_op.h" 3 #include "caffe2/utils/math.h" 7 REGISTER_CPU_OPERATOR(Floor, FloorOp<float, CPUContext>);
12 .AllowInplace({{0, 0}})
14 Element-wise application of the floor function ($y=floor(x)$) to the input 15 tensor `X`. Output tensor shape is the same as the input tensor. This 16 operator can be used in an in-place fashion by using the same input blob as the 20 - https://github.com/pytorch/pytorch/blob/master/caffe2/operators/floor_op.cc 24 <summary> <b>Example</b> </summary> 30 workspace.ResetWorkspace() 32 op = core.CreateOperator( 38 workspace.FeedBlob("X", (np.random.uniform(-10, 10, (5,5))).astype(np.float32)) 39 print("X before running op:", workspace.FetchBlob("X")) 40 workspace.RunOperatorOnce(op) 41 print("X after running op:", workspace.FetchBlob("X")) 50 [[ 3.813361 -1.319647 5.2089314 -4.931328 0.6218652 ] 51 [ 7.2757645 5.5552588 5.785643 -2.4790506 -0.41400087] 52 [ 1.1541046 -6.933266 3.3754056 1.6569928 -1.7670316 ] 53 [-3.4932013 4.891472 1.5530115 -3.2443287 -4.605099 ] 54 [-4.574543 -7.360948 5.91305 -8.196495 -5.357458 ]] 67 .Input(0, "X",
"*(type: Tensor`<float>`)* Input tensor.")
68 .Output(0,
"Y",
"*(type: Tensor`<float>`)* Output tensor.");
71 GRADIENT_NOT_IMPLEMENTED_YET(Floor);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...