File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ class InverseOp : public framework::OperatorWithKernel {
3535 " The dimension of Input(Input) is expected to be no less than 2. "
3636 " But recieved: Input(Input)'s dimension = %d, shape = [%s]." ,
3737 input_rank, input_dims));
38+ for (int64_t i = 0 ; i < input_rank; ++i) {
39+ PADDLE_ENFORCE_EQ (
40+ (input_dims[i] == -1 ) || (input_dims[i] > 0 ), true ,
41+ platform::errors::InvalidArgument (
42+ " Each dimension of input tensor is expected to be -1 or a "
43+ " positive number, but recieved %d. Input's shape is [%s]." ,
44+ input_dims[i], input_dims));
45+ }
3846 if (input_dims[input_rank - 2 ] > 0 && input_dims[input_rank - 1 ] > 0 ) {
3947 PADDLE_ENFORCE_EQ (input_dims[input_rank - 2 ], input_dims[input_rank - 1 ],
4048 platform::errors::InvalidArgument (
You can’t perform that action at this time.
0 commit comments