1 #include "caffe2/operators/length_split_op.h" 5 REGISTER_CPU_OPERATOR(LengthsSplit, LengthsSplitOp<CPUContext>);
7 OPERATOR_SCHEMA(LengthsSplit)
10 .ScalarType(TensorProto::INT32)
12 Given input vector LENGTHS, and input n_split, LengthsSplit returns 13 a single output vector. It "splits" each length into n_split values which add 14 up to the original length. It will attempt to do equal splits, and if not possible, 15 it orders larger values first. If the n_split is larger than the length, zero 16 padding will be applied. 18 e.g. LENGTHS = [9 4 5] 20 Y = [3 3 3 2 1 1 2 2 1] 22 e.g. LENGTHS = [2, 1, 2] 24 Y = [1 1 0 1 0 0 1 1 0] 26 .Arg("n_split",
"Number of splits for each element in LENGTHS")
27 .Input(0,
"LENGTHS",
"Mx1 Input tensor denoting INT32 lengths")
31 "(Optional) Number of splits for each element in LENGTHS (overrides argument)")
32 .Output(0,
"Y",
"(M*n_split)x1 Output vector denoting split lengths");
35 GRADIENT_NOT_IMPLEMENTED_YET(LengthsSplit);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...