class_docstr: Base class for testing proto decoding ops.
code: def testCorruptProtobuf(self, sanitize):
      corrupt_proto = "This is not a binary protobuf"
  
      # Numpy silently truncates the strings if you don't specify dtype=object.
      batch = np.array(corrupt_proto, dtype=object)
      msg_type = "tensorflow.contrib.proto.TestCase"
      field_names = ["sizes"]
      field_types = [dtypes.int32]
  
      with self.assertRaisesRegexp(
          errors.DataLossError,
          "Unable to parse binary protobuf"
          "|Failed to consume entire buffer",
      ):
          self.evaluate(
              self._decode_module.decode_proto(
                  batch,
                  message_type=msg_type,
                  field_names=field_names,
                  output_types=field_types,
                  sanitize=sanitize,
              )
          )
  
imports: import itertools
  from absl.testing import parameterized
  import numpy
  from google.protobuf import text_format
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.kernel_tests.proto import proto_op_test_base
  from tensorflow.python.kernel_tests.proto import test_example_pb2
label_desc: Use image node_id 10 for calling the DecodeProtoOpTestBase obj's underlying member method code with example usage: obj.testCorruptProtobuf(sanitize) without return types