1 #include "caffe2/operators/lengths_tile_op.h" 4 REGISTER_CPU_OPERATOR(LengthsTile, LengthsTileOp<CPUContext>);
6 OPERATOR_SCHEMA(LengthsTile)
10 Given DATA tensor of rank r >= 1, and LENGTHS tensor of rank 1, duplicate each 11 entry of the outer-most dimension of DATA according to LENGTHS, and concatenate 12 them in an output tensor of rank r. 21 LENGTHS = [0, 1, 3, 2] 34 "Tensor of rank r >= 1. First dimension must be equal to the size of " 36 .Input(1,
"LENGTHS",
"Tensor of int32 lengths of rank 1")
37 .Output(0,
"OUTPUT",
"Tensor of rank r");
39 class GetLengthsTileGradient :
public GradientMakerBase {
40 using GradientMakerBase::GradientMakerBase;
41 vector<OperatorDef> GetGradientDefs()
override {
42 CAFFE_ENFORCE_EQ(def_.input_size(), 2);
43 return SingleGradientDef(
48 vector<string>{GO(0), I(1)},
50 vector<string>{GI(0)});
53 REGISTER_GRADIENT(LengthsTile, GetLengthsTileGradient);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...