  def testBadAxis(self):
    input_tensor = [2.5, 2.5]
    input_min = [0, 0]
    input_max = [1, 1]
    error_message_pattern = "Shape must be at least rank 11 but is rank 1"
    # TODO(b/171260356): Eager mode and graph mode throw different error types
    error = errors.InvalidArgumentError if context.executing_eagerly(
    ) else ValueError
    with self.assertRaisesRegex(error, error_message_pattern):
      self.evaluate(
          array_ops.quantize_and_dequantize_v2(
              input=input_tensor,
              input_min=input_min,
              input_max=input_max,
              axis=10))
The software reads data past the end, or before the beginning, of the intended buffer.