Language: Python
Label: safe
CWE: CWE-697 \u2014 Incorrect Comparison
The product compares two entities in a security-relevant context, but the comparison is incorrect, which may lead to resultant weaknesses.

Code:
  def testAvgPoolGradSamePaddingZeroStrideZeroSize(self):
    output_gradient_vals = np.array([0.39117979], dtype=np.float32)
    output_gradient_vals = output_gradient_vals.reshape([1, 1, 1, 1])
    with self.session() as sess:
      with self.test_scope():
        output_gradients = array_ops.placeholder(
            dtypes.float32, shape=output_gradient_vals.shape
        )
        t = gen_nn_ops.avg_pool_grad(
            orig_input_shape=[1, 0, 0, 0],
            grad=output_gradients,
            ksize=[1, 0, 0, 0],
            strides=[1, 0, 0, 0],
            padding="SAME",
            data_format="NCHW",
        )
      with self.assertRaisesRegex(
          errors.InvalidArgumentError,
          (
              "Sliding window ksize field for dimension 1 must be positive but"
              " is 0"
          ),
      ):
        sess.run(t, {output_gradients: output_gradient_vals})