class_docstr: Method for tensor value assignment via indexing and slicing.
  Suppose we have a tensor ``x``, this method achieves:
  ``x[begin[0]: end[0]: stride[0], begin[1]: end[1]: stride[1], ...] = value``
  
  Parameters
  ----------
  x: tensor<*?, T> (Required)
      * Input tensor
  updates: tensor<\*K, T> (Required)
      * Value tensor to be inserted
      * The shape of the updates tensor must match the slicing result of the input data ``x``.
  begin: tensor<[rank<x>], i32> (Required)
      * Starting index for the dimension of slicing.
  end: tensor<[rank(x)], i32> (Required)
      * Ending index for the dimension of slicing.
  stride: tensor<[rank(x)], i32> (Optional)
      * Default as all ``1``s.
      * Stride for the dimension of slicing.
  begin_mask: tensor<[rank(x)], bool> (Optional)
      * Default to all ``False``.
      * If ``begin_mask[i]==True``, neglect ``begin[i]``, and set ``begin[i]`` to ``0``.
  end_mask: tensor<[rank(x)], bool> (Optional)
      * Default to all ``False``.
      * If ``end_mask[i]==True``, neglect ``end[i]``, and set ``end[i]`` to ``x.shape[i]``.
  squeeze_mask: tensor<[rank(x)], bool> (Optional)
      * Default to all ``False``.
      * If ``squeeze_mask[i]==True``, neglect ``end[i]``, and do the pure index at ``begin[i]``.
  
  Returns
  -------
  tensor<*?, T>
      - Scalar or tensor.
  
  Attributes
  ----------
  T: fp16, fp32, i32
code: def type_inference(self):
      # solve shape
      ret_shape = solve_slice_by_index_shape(
          self.x.shape,
          self.begin.val,
          self.end.val,
          get_param_val(self.stride),
          get_param_val(self.begin_mask),
          get_param_val(self.end_mask),
          get_param_val(self.squeeze_mask),
      )
      if not is_compatible_symbolic_vector(
          ret_shape, self.updates.shape
      ):
          raise ValueError(
              "The updates tensor should have shape {}. Got {}".format(
                  ret_shape, self.updates.shape
              )
          )
  
      return self.x.sym_type
  
file_path: coremltools/coremltools/converters/mil/frontend/torch/dialect_ops.py
imports: from coremltools.converters.mil.mil import Operation, get_new_symbol, types
  from coremltools.converters.mil.mil.input_type import DefaultInputs, InputSpec, TensorInputType
  from coremltools.converters.mil.mil.ops.defs._utils import get_param_val, solve_slice_by_index_shape
  from coremltools.converters.mil.mil.ops.registry import SSAOpRegistry
  from coremltools.converters.mil.mil.types.symbolic import is_compatible_symbolic_vector
label_desc: Use image node_id 2 for calling the torch_tensor_assign obj's underlying member method code with example usage: obj.type_inference() and returns: self