Caffe2 - C++ API
A deep learning, cross platform ML framework
int8_slice_op.cc
1 #include "caffe2/operators/quantized/int8_slice_op.h"
2 
3 namespace caffe2 {
4 
5 REGISTER_CPU_OPERATOR(Int8Slice, int8::Int8SliceOp);
6 
7 OPERATOR_SCHEMA(Int8Slice)
8  .NumInputs(1, 3)
9  .NumOutputs(1)
10  .SetDoc(R"DOC(
11 Produces a slice of the input Int8 tensor. Currently, only slicing in a single
12 dimension is supported.
13 Slices are passed as 2 1D vectors or as two keyword argument lists with starting
14 and end indices for each dimension of the input `data` tensor. If a negative
15 value is passed for any of the start or end indices, it represents the number of
16 elements before the end of that dimension. End indices are non-inclusive unless
17 negative (end index -1 means up to and including the last element).
18 
19 
20 Example:
21 
22  data = [
23  [1, 2, 3, 4],
24  [5, 6, 7, 8],
25  ]
26  starts = [0, 1]
27  ends = [-1, 3]
28 
29  result = [
30  [2, 3],
31  [6, 7],
32  ]
33 )DOC")
34  .Input(0, "data", "Int8 Tensor of data to extract slices from.")
35  .Input(1, "starts", "1D tensor: start-indices for each dimension of data.")
36  .Input(2, "ends", "1D tensor: end-indices for each dimension of data.")
37  .Arg("Y_scale", "Output tensor quantization scale")
38  .Arg("Y_zero_point", "Output tensor quantization offset")
39  .Arg("starts", "List of starting indices")
40  .Arg("ends", "List of ending indices")
41  .Output(0, "output", "Sliced Int8 data tensor.")
42  .InheritOnnxSchema("Slice");
43 
44 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13