Skip to content

Commit 06e6ae6

Browse files
committed
fix rank_internal works for both kNN and CNN examples.
1 parent 5466d95 commit 06e6ae6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TensorFlowNET.Core/Operations/array_ops.py.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public static Tensor rank_internal(Tensor input, string name = null, bool optimi
143143
name = scope;
144144
var input_tensor = ops.convert_to_tensor(input);
145145
var input_shape = tensor_util.to_shape(input_tensor.shape);
146-
if (optimize && input_shape.NDim > -1)
146+
if (optimize && input_shape.NDim > 0)
147147
return constant_op.constant(input_shape.NDim, dtype: tf.int32, name: name);
148148
else
149149
return gen_array_ops.rank(input, name);

0 commit comments

Comments
 (0)