Improve error message of strided slice op.
PiperOrigin-RevId: 340555916 Change-Id: I246fcc739feba88f03c1891175c0ba44bd03fee8
This commit is contained in:
parent
6def0d4746
commit
1e228f57d2
@ -223,12 +223,10 @@ class StridedSliceOp : public XlaOpKernel {
|
|||||||
input_elements_sliced *= input_shape.dim_size(d);
|
input_elements_sliced *= input_shape.dim_size(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
OP_REQUIRES(
|
OP_REQUIRES(ctx, output_elements == input_elements_sliced,
|
||||||
ctx, output_elements == input_elements_sliced,
|
errors::InvalidArgument(
|
||||||
errors::InvalidArgument(
|
"Dynamic indices of strided_slice_op have to be leading "
|
||||||
"The number of output elements ", output_elements,
|
"dimensions in the indices list."));
|
||||||
" has to equal to number of input elements that are sliced ",
|
|
||||||
input_elements_sliced, " when input indices are not constant."));
|
|
||||||
|
|
||||||
for (int64 i = 0; i < ctx->InputShape("begin").dims(); ++i) {
|
for (int64 i = 0; i < ctx->InputShape("begin").dims(); ++i) {
|
||||||
OP_REQUIRES(
|
OP_REQUIRES(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user