class_docstr: Handler for `FixedLenFeature` values.
  
  `FixedLenFeature` values will be parsed to a list of the corresponding
  dtype.
class_docstr_tok: ["Handler","for","`","FixedLenFeature","`","values",".","`","FixedLenFeature","`","values","will","be","parsed","to","a","list","of","the","corresponding","dtype","."]
docstr: Encodes a feature into its Example proto representation.
docstr_tok: ["Encodes","a","feature","into","its","Example","proto","representation","."]
code: def encode_value(self, values):
      """Encodes a feature into its Example proto representation."""
      del self._value[:]
      if self._rank == 0:
          scalar_value = (
              values
              if not isinstance(values, np.ndarray)
              else values.item()
          )
          self._value.append(self._cast_fn(scalar_value))
      else:
          flattened_values = (
              values
              if self._rank == 1
              else np.asarray(values, dtype=self._np_dtype).reshape(-1)
          )
          if len(flattened_values) != self._size:
              raise ValueError(
                  "FixedLenFeature %r got wrong number of values. "
                  "Expected %d but got %d"
                  % (self._name, self._size, len(flattened_values))
              )
          self._value.extend(self._cast_fn(flattened_values))
  
file_path: transform/tensorflow_transform/coders/example_proto_coder.py
imports: import numpy
  import tensorflow
  from tensorflow_transform.tf_metadata import schema_utils
label_desc: Use image node_id 4 for calling the _FixedLenFeatureHandler obj's underlying member method code with example usage: obj.encode_value(values) without return types