class_docstr: Scatter ``values`` to ``ls`` at locations ``indices``.
  
  Parameters
  ----------
  ls: List[*] (Required)
  
  indices: tensor<num_updates, i32> (Required)
      * Indices of ``ls`` to scatter to.
      * Elements of ``indices`` must be in ``[0, ls.length)`` at runtime.
      * If indices are greater than or equal to the list length, the list is
        dynamically resized.
  
  value: <*,T> (Optional)
      * Element value to write, which must match the element shape of ``ls``.
      * Default is ``None``.
  
  Returns
  -------
  List[*]
      * Updated list.
  
  Attributes
  ----------
  T: fp16, fp32, i32, bool
class_docstr_tok: ["Scatter","``","values","``","to","``","ls","``","at","locations","``","indices","``",".","Parameters","--","--","--","--","--","ls",":","List","[","*","]","(","Required",")","indices",":","tensor","<","num_updates",",","i32",">","(","Required",")","*","Indices","of","``","ls","``","to","scatter","to",".","*","Elements","of","``","indices","``","must","be","in","``","[","0",",","ls.length",")","``","at","runtime",".","*","If","indices","are","greater","than","or","equal","to","the","list","length",",","the","list","is","dynamically","resized",".","value",":","<","*",",","T",">","(","Optional",")","*","Element","value","to","write",",","which","must","match","the","element","shape","of","``","ls","``",".","*","Default","is","``","None","``",".","Returns","--","--","--","-","List","[","*","]","*","Updated","list",".","Attributes","--","--","--","--","--","T",":","fp16",",","fp32",",","i32",",","bool"]
code: def type_inference(self):
      num_indices = self.indices.shape[0]
      num_values = self.value.shape[0]
      if num_values != num_indices:
          raise ValueError(
              "Cannot scatter {} values to {} indices".format(
                  num_values, num_indices
              )
          )
      list_elem_type = self.ls.elem_type
      value_type = self.value.sym_type
      dynamic_length = self.ls.dynamic_length
      init_length = self.ls.init_length
  
      elem_type = types.tensor(
          value_type.get_primitive(), value_type.get_shape()[1:]
      )
      if list_elem_type == types.unknown:
          # fill in the elem type using value's type info.
          return types.list(
              elem_type,
              dynamic_length=dynamic_length,
              init_length=init_length,
          )
      if not types.is_subtype(elem_type, list_elem_type):
          msg = (
              "Elem type mismatch: ls elem type {} vs "
              + "value type {}"
          )
          raise ValueError(msg.format(list_elem_type, elem_type))
      return self.ls.sym_type
  
imports: import copy
  import numpy
  from coremltools import _logger
  from coremltools.converters.mil.mil import Block, get_existing_symbol, get_new_symbol, types
  from coremltools.converters.mil.mil.input_type import DefaultInputs, InputSpec, InternalInputType, ListInputType, PyFunctionInputType, TensorInputType, TupleInputType
  from coremltools.converters.mil.mil.operation import NONE, SYMBOL, VALUE, Operation, mil_list, precondition
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
  from coremltools.converters.mil.mil.ops.defs._utils import infer_type_with_broadcast, promoted_primitive_type
  from coremltools.converters.mil.mil.types import is_compatible_type
  from coremltools.converters.mil.mil.types.type_list import list
  from coremltools.converters.mil.mil.types.type_mapping import builtin_to_string, is_subtype, numpy_type_to_builtin_type, numpy_val_to_builtin_val
label_desc: Use image node_id 1 for calling the list_scatter obj's underlying member method code with example usage: obj.type_inference() and returns: self, types