1 #include "caffe2/operators/quantized/int8_softmax_op.h" 5 REGISTER_CPU_OPERATOR(Int8Softmax, int8::Int8SoftmaxOp);
7 OPERATOR_SCHEMA(Int8Softmax)
10 .Arg(
"Y_scale",
"Output tensor quantization scale")
11 .Arg(
"Y_zero_point",
"Output tensor quantization offset")
12 .IdenticalTypeAndShape()
14 The operator computes the softmax normalized values for each layer in the batch 15 of the given input. The input is a 2-D tensor (Tensor<float>) of size 16 (batch_size x input_feature_dimensions). The output tensor has the same shape 17 and contains the softmax normalized values of the corresponding input. 19 X does not need to explicitly be a 2D vector; rather, it will be 20 coerced into one. For an arbitrary n-dimensional tensor 21 X \in [a_0, a_1, ..., a_{k-1}, a_k, ..., a_{n-1}] and k is 22 the axis provided, then X will be coerced into a 2-dimensional tensor with 23 dimensions [a_0 * ... * a_{k-1}, a_k * ... * a_{n-1}]. For the default 24 case where axis=1, this means the X tensor will be coerced into a 2D tensor 25 of dimensions [a_0, a_1 * ... * a_{n-1}], where a_0 is often the batch size. 26 In this situation, we must have a_0 = N and a_1 * ... * a_{n-1} = D. 27 Each of these dimensions must be matched correctly, or else the operator 32 "(int) default to 1; describes the axis of the inputs when coerced " 33 "to 2D; defaults to one because the 0th axis most likely describes " 38 "The input tensor that's coerced into a 2D matrix of size (NxD) " 39 "as described above.")
43 "The softmax normalized output values with the same " 44 "shape as input tensor.");
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...