parameters: (value: Tensor, dim: str, unpacked_dims: Shape)
docstring: Decompresses a tensor dimension by unstacking the elements along it.
      This function replaces the traditional `reshape` for these cases.
      The compressed dimension `dim` is assumed to contain elements laid out according to the order of `split_dims`.
  
      See Also:
          `pack_dims()`
  
      Args:
          value: `Tensor` for which one dimension should be split.
          dim: Compressed dimension to be decompressed.
          unpacked_dims: Ordered new dimensions to replace `dim` as `Shape`.
  
      Returns:
          `Tensor` with decompressed shape
docstring_summary: Decompresses a tensor dimension by unstacking the elements along it.
      This function replaces the traditional `reshape` for these cases.
      The compressed dimension `dim` is assumed to contain elements laid out according to the order of `split_dims`.
docstring_tokens: Decompresses a tensor dimension by unstacking the elements along it . This function replaces the traditional reshape for these cases . The compressed dimension dim is assumed to contain elements laid out according to the order of split_dims .
function: def unpack_dims(value: Tensor, dim: str, unpacked_dims: Shape):
      """
      Decompresses a tensor dimension by unstacking the elements along it.
      This function replaces the traditional `reshape` for these cases.
      The compressed dimension `dim` is assumed to contain elements laid out according to the order of `split_dims`.
  
      See Also:
          `pack_dims()`
  
      Args:
          value: `Tensor` for which one dimension should be split.
          dim: Compressed dimension to be decompressed.
          unpacked_dims: Ordered new dimensions to replace `dim` as `Shape`.
  
      Returns:
          `Tensor` with decompressed shape
      """
      if unpacked_dims.rank == 0:
          return value.dimension(dim)[0]  # remove dim
      if unpacked_dims.rank == 1:
          return rename_dims(value, dim, unpacked_dims)
      else:
          native = value.native(value.shape.names)
          new_shape = value.shape.without(dim)
          i = value.shape.index(dim)
          for d in unpacked_dims:
              new_shape = new_shape._expand(d, pos=i)
              i += 1
          native_reshaped = choose_backend(native).reshape(native, new_shape.sizes)
          return NativeTensor(native_reshaped, new_shape)
function_tokens: def unpack_dims ( value : Tensor , dim : str , unpacked_dims : Shape ) : if unpacked_dims . rank == 0 : return value . dimension ( dim ) [ 0 ] # remove dim if unpacked_dims . rank == 1 : return rename_dims ( value , dim , unpacked_dims ) else : native = value . native ( value . shape . names ) new_shape = value . shape . without ( dim ) i = value . shape . index ( dim ) for d in unpacked_dims : new_shape = new_shape . _expand ( d , pos = i ) i += 1 native_reshaped = choose_backend ( native ) . reshape ( native , new_shape . sizes ) return NativeTensor ( native_reshaped , new_shape )