Skip to content

Commit a0745a7

Browse files
author
Thomas Lee
authored
Fix an error message.
Minimum tensor rank should be (dim + 1) instead of (dim). Example: tf.argmin(x, 1) # x is a 1-d vector. before: "InvalidArgumentError: Minimum tensor rank: 1 but got: 1" after: "InvalidArgumentError: Minimum tensor rank: 2 but got: 1"
1 parent 4fb28d6 commit a0745a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorflow/core/kernels/argmax_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ArgOp : public OpKernel {
5959

6060
OP_REQUIRES(context, dim >= 0, errors::InvalidArgument("dim must be >= 0"));
6161
OP_REQUIRES(context, dim < input_dims,
62-
errors::InvalidArgument("Minimum tensor rank: ", dim,
62+
errors::InvalidArgument("Minimum tensor rank: ", dim + 1,
6363
" but got: ", input_dims));
6464
OP_REQUIRES(
6565
context, input.dim_size(dim) > 0,

0 commit comments

Comments
 (0)