parameters: (inputs, optimize=True)
return_statement: return casted_outputs
docstring: Convert all elements of 'inputs' to IndexedSlices.
  
    Additionally, homogenize the types of all the indices to
    either int32 or int64.
  
    Args:
      inputs: List containing either Tensor or IndexedSlices objects.
      optimize: if true, attempt to optimize the conversion of each input.
  
    Returns:
      A list of IndexedSlices objects.
  
    Raises:
      TypeError: If 'inputs' is not a list or a tuple.
docstring_summary: Convert all elements of 'inputs' to IndexedSlices.
docstring_tokens: Convert all elements of inputs to IndexedSlices .
function: def _as_indexed_slices_list(inputs, optimize=True):
    """Convert all elements of 'inputs' to IndexedSlices.
  
    Additionally, homogenize the types of all the indices to
    either int32 or int64.
  
    Args:
      inputs: List containing either Tensor or IndexedSlices objects.
      optimize: if true, attempt to optimize the conversion of each input.
  
    Returns:
      A list of IndexedSlices objects.
  
    Raises:
      TypeError: If 'inputs' is not a list or a tuple.
    """
    if not isinstance(inputs, (list, tuple)):
      raise TypeError(f"Expected a list or tuple, not {type(inputs)}.")
    outputs = [_as_indexed_slices(i, optimize=optimize) for i in inputs]
    with_int32_index = [
        o.indices for o in outputs if o.indices.dtype == dtypes.int32
    ]
    if not with_int32_index or len(with_int32_index) == len(outputs):
      return outputs
    casted_outputs = []
    for o in outputs:
      if o.indices.dtype == dtypes.int32:
        casted_outputs.append(
            indexed_slices.IndexedSlices(o.values, cast(o.indices, dtypes.int64),
                                         o.dense_shape))
      else:
        casted_outputs.append(o)
    return casted_outputs
function_tokens: def _as_indexed_slices_list ( inputs , optimize = True ) : if not isinstance ( inputs , ( list , tuple ) ) : raise TypeError ( f"Expected a list or tuple, not {type(inputs)}." ) outputs = [ _as_indexed_slices ( i , optimize = optimize ) for i in inputs ] with_int32_index = [ o . indices for o in outputs if o . indices . dtype == dtypes . int32 ] if not with_int32_index or len ( with_int32_index ) == len ( outputs ) : return outputs casted_outputs = [ ] for o in outputs : if o . indices . dtype == dtypes . int32 : casted_outputs . append ( indexed_slices . IndexedSlices ( o . values , cast ( o . indices , dtypes . int64 ) , o . dense_shape ) ) else : casted_outputs . append ( o ) return casted_outputs