class_docstr: Base class for testing proto decoding ops.
docstr: Compare lists/arrays of field values.
docstr_tok: ["Compare","lists\/arrays","of","field","values","."]
code: def _compareValues(self, fd, vs, evs):
      """Compare lists/arrays of field values."""
  
      if len(vs) != len(evs):
          self.fail(
              "Field %s decoded %d outputs, expected %d"
              % (fd.name, len(vs), len(evs))
          )
      for i, ev in enumerate(evs):
          # Special case fuzzy match for float32. TensorFlow seems to mess with
          # MAX_FLT slightly and the test doesn't work otherwise.
          # TODO(nix): ask on TF list about why MAX_FLT doesn't pass through.
          if fd.cpp_type == fd.CPPTYPE_FLOAT:
              # Numpy isclose() is better than assertIsClose() which uses an absolute
              # value comparison.
              self.assertTrue(
                  np.isclose(vs[i], ev),
                  "expected %r, actual %r" % (ev, vs[i]),
              )
          elif fd.cpp_type == fd.CPPTYPE_STRING:
              # In Python3 string tensor values will be represented as bytes, so we
              # reencode the proto values to match that.
              self.assertEqual(vs[i], ev.encode("ascii"))
          else:
              # Doubles and other types pass through unscathed.
              self.assertEqual(vs[i], ev)
  
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 2 for calling the DecodeProtoOpTestBase obj's underlying member method code with example usage: obj._compareValues(fd, vs, evs) without return types