class_docstr: Represents the TraceType of a class implmenting the CustomNestProtocol.
class_docstr_tok: ["Represents","the","TraceType","of","a","class","implmenting","the","CustomNestProtocol","."]
code: def to_tensors(self, value: Any) -> PythonList[Any]:
      if not isinstance(value, self.value_type):
          raise TypeError(
              f"{value!r} is not of type {self.value_type}."
          )
      _, value_components = value.__tf_flatten__()
      flattened_values = []
      for value_comp, type_comp in zip(
          value_components, self.components
      ):
          flattened_values.extend(type_comp.to_tensors(value_comp))
      return flattened_values
  
file_path: tensorflow/tensorflow/core/function/trace_type/custom_nest_trace_type.py
imports: from typing import Any, Iterator, List, Optional, Sequence, Tuple, Type
  from tensorflow.core.function.trace_type import util
  from tensorflow.python.types import trace
  from tensorflow.python.util import custom_nest_protocol
label_desc: Use image node_id 8 for calling the CustomNestTraceType obj's underlying member method code with example usage: obj.to_tensors(value) and returns: flattened_values