class_docstr: Packed representation of compressed tensors.
  
  This class can pack and unpack several tensor values into a single string. It
  can also optionally store a model identifier.
  
  The tensors currently must be rank 1 (vectors) and either have integer or
  string type.
docstr: Packs `Tensor` values into this object.
code: def pack(self, tensors):
      """Packs `Tensor` values into this object."""
      i = 1
      for tensor in tensors:
          feature = self._example.features.feature[chr(i)]
          feature.Clear()
          if tensor.shape.rank != 1:
              raise RuntimeError(
                  f"Unexpected tensor rank: {tensor.shape.rank}."
              )
          if tensor.dtype.is_integer:
              feature.int64_list.value[:] = tensor.numpy()
          elif tensor.dtype.is_floating:
              feature.float_list.value[:] = tensor.numpy()
          elif tensor.dtype == tf.string:
              feature.bytes_list.value[:] = tensor.numpy()
          else:
              raise RuntimeError(
                  f"Unexpected tensor dtype: '{tensor.dtype}'."
              )
          i += 1
      # Delete any remaining, previously set arrays.
      while chr(i) in self._example.features.feature:
          del self._example.features.feature[chr(i)]
          i += 1
  
file_path: compression/tensorflow_compression/python/util/packed_tensors.py
imports: import tensorflow
label_desc: Use image node_id 7 for calling the PackedTensors obj's underlying member method code with example usage: obj.pack(tensors) without return types