Caffe2 - C++ API A deep learning, cross platform ML framework
int8_softmax_op.cc
1 #include "caffe2/operators/quantized/int8_softmax_op.h"
2
3 namespace caffe2 {
4
5 REGISTER_CPU_OPERATOR(Int8Softmax, int8::Int8SoftmaxOp);
6
7 OPERATOR_SCHEMA(Int8Softmax)
8  .NumInputs(1)
9  .NumOutputs(1)
10  .Arg("Y_scale", "Output tensor quantization scale")
11  .Arg("Y_zero_point", "Output tensor quantization offset")
12  .IdenticalTypeAndShape()
13  .SetDoc(R"DOC(
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.
18
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
28 will throw errors.
29 )DOC")
30  .Arg(
31  "axis",
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 "
34  "the batch_size")
35  .Input(
36  0,
37  "input",
38  "The input tensor that's coerced into a 2D matrix of size (NxD) "
39  "as described above.")
40  .Output(
41  0,
42  "output",
43  "The softmax normalized output values with the same "
44  "shape as input tensor.");
45
46 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13