class_docstr: Base class for testing proto encoding ops.
class_docstr_tok: ["Base","class","for","testing","proto","encoding","ops","."]
code: def testRoundtrip(self, case):
      in_bufs = [value.SerializeToString() for value in case.values]
  
      # np.array silently truncates strings if you don't specify dtype=object.
      in_bufs = np.reshape(
          np.array(in_bufs, dtype=object), list(case.shapes)
      )
      return self._testRoundtrip(
          in_bufs, "tensorflow.contrib.proto.TestValue", case.fields
      )
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/proto/encode_proto_op_test_base.py
imports: from absl.testing import parameterized
  import numpy
  from google.protobuf import text_format
  from tensorflow.python.eager import context
  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
  from tensorflow.python.ops import array_ops
label_desc: Use image node_id 5 for calling the EncodeProtoOpTestBase obj's underlying member method code with example usage: obj.testRoundtrip(case) and returns: self