code: def TensorListFromTensor(context, node):
      value = context[node.inputs[0]]
      element_shape = context[node.inputs[1]]
      element_dtype = node.attr.get("element_dtype")
      dtype_str = builtin_to_string(element_dtype)
  
      length = mb.shape(x=value)
      length = mb.slice_by_index(
          x=length, begin=[0], end=[1], squeeze_mask=[True]
      )
  
      if element_shape is not None and all(
          _np.atleast_1d(element_shape.val) != -1
      ):
          ls = mb.make_list(
              init_length=length,
              elem_shape=tuple(element_shape.val.tolist()),
              dtype=dtype_str,
          )
      else:
          ls = mb.tf_make_list(init_length=length, dtype=dtype_str)
  
      indices = mb.range_1d(end=length, start=0, step=1)
      ls = mb.list_scatter(
          ls=ls, indices=indices, value=value, name=node.name
      )
      context.add(node.name, ls)
  
file_path: coremltools/coremltools/converters/mil/frontend/tensorflow2/ops.py
imports: import numpy
  from coremltools.converters.mil.frontend.tensorflow.convert_utils import convert_graph
  from coremltools.converters.mil.frontend.tensorflow.ops import _transpose_NCDHW_to_NDHWC, _transpose_NCHW_to_NHWC, _transpose_NDHWC_to_NCDHW, _transpose_NHWC_to_NCHW
  from coremltools.converters.mil.frontend.tensorflow.tf_op_registry import register_tf_op
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.types import builtin_to_string
  from coremltools.converters.mil.mil.types.symbolic import any_symbolic
label_desc: Use image node_id 4 for calling a global function with example usage: TensorListFromTensor(context, node) without return types