@@ -56,55 +56,56 @@ class CropOpMaker : public framework::OpProtoAndCheckerMaker {
5656 : OpProtoAndCheckerMaker(proto, op_checker) {
5757 AddInput (" X" ,
5858 " The input of pad op. "
59- " The input should be a k-D tensor(k > 0 and k < 7)" );
59+ " The input should be a k-D tensor(k > 0 and k < 7). " );
6060 AddInput (" Y" ,
61- " The input used as reference for cropping"
62- " with the same dimension as X. " )
61+ " The input used as reference for cropping, "
62+ " which is of the same dimensions as X." )
6363 .AsDispensable ();
6464 AddOutput (" Out" ,
65- " The output of crop op "
66- " with the same dimension as X." );
65+ " The output of crop op, "
66+ " which is of the same dimensions as X." );
6767 AddAttr<std::vector<int >>(" offsets" ,
68- " A list<int> describing offsets to be cropped."
69- " The size of offsets list should be as same as "
70- " dimension size of input X." );
68+ " A list<int> describing offsets to be cropped. "
69+ " The size of offsets list should be the same as "
70+ " the dimension size of input X." );
7171 AddAttr<std::vector<int >>(" shape" ,
72- " A list<int> describing the shape of output."
73- " The size of shape list should be as same as "
74- " dimension size of input X." )
72+ " A list<int> describing the shape of output. "
73+ " The size of shape list should be the same as "
74+ " the dimension size of input X." )
7575 .SetDefault (std::vector<int >());
7676 AddComment (R"DOC(
7777Crop Operator.
78+
7879Crop input into output, as specified by offsets and shape.
7980
8081There are two ways to set shape:
81- 1. referenc input: crop input X as shape as reference input.
82+ 1. reference input: crop input X into the same shape as reference input.
8283 The dimension of reference input should
83- be as same as input X.
84- 2. shape list: crop input X by shape described by a list<int>.
85- The size of shape list should be as same as
86- dimension size of input X.
84+ be the same as the dimension of input X.
85+ 2. shape list: crop input X into the shape described by a list<int>.
86+ The size of shape list should be the same as
87+ the dimension size of input X.
8788
8889The input should be a k-D tensor(k > 0 and k < 7). As an example:
8990
9091Given:
9192
9293 X = [[0, 1, 2, 0, 0]
9394 [0, 3, 4, 0, 0]
94- [0, 0, 0, 0, 0]]
95+ [0, 0, 0, 0, 0]],
9596
9697and
9798
98- offsets = [0, 1]
99+ offsets = [0, 1],
99100
100101and
101102
102- shape = [2, 2]
103+ shape = [2, 2],
103104
104- then we get
105+ we get:
105106
106107 Out = [[1, 2],
107- [3, 4]]
108+ [3, 4]].
108109
109110)DOC" );
110111 }
0 commit comments