We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
tf.raw_ops.DenseCountSparseOutput
1 parent efff014 commit da5ff2dCopy full SHA for da5ff2d
tensorflow/core/kernels/count_ops.cc
@@ -122,6 +122,9 @@ class DenseCount : public OpKernel {
122
123
int num_batch_elements = 1;
124
for (int i = 0; i < num_batch_dimensions; ++i) {
125
+ OP_REQUIRES(context, data.shape().dim_size(i) != 0,
126
+ errors::InvalidArgument(
127
+ "Invalid input: Shapes dimension cannot be 0."));
128
num_batch_elements *= data.shape().dim_size(i);
129
}
130
int num_value_elements = data.shape().num_elements() / num_batch_elements;
0 commit comments