code: def update_tensortype(t_type, shape, data_type):
      """
      Update in-place of t_type (TensorType) to shape and data_type.
      """
      t_type.dataType = data_type
      t_type.rank = len(shape)
      t_type.ClearField("dimensions")
      for s in shape:
          t_dim = t_type.dimensions.add()
          set_proto_dim(t_dim, s)
  
imports: import os
  import numpy
  import coremltools.proto.FeatureTypes_pb2
  import coremltools.proto.MIL_pb2
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.types import BUILTIN_TO_PROTO_TYPES, builtin_to_string, numpy_type_to_builtin_type, type_to_builtin_type
  from coremltools.converters.mil.mil.types.type_mapping import np_val_to_py_type
  from coremltools.models.utils import _WEIGHTS_DIR_NAME, _WEIGHTS_FILE_NAME
label_desc: Use image node_id 7 for calling a global function with example usage: update_tensortype(t_type, shape, data_type) without return types