def _as_indexed_slices_list(inputs, optimize=True):
    "Convert all elements of 'inputs' to IndexedSlices.\n\n  Additionally, homogenize the types of all the indices to\n  either int32 or int64.\n\n  Args:\n    inputs: List containing either Tensor or IndexedSlices objects.\n    optimize: if true, attempt to optimize the conversion of each input.\n\n  Returns:\n    A list of IndexedSlices objects.\n\n  Raises:\n    TypeError: If 'inputs' is not a list or a tuple.\n  "
    if (not isinstance(inputs, (list, tuple))):
        raise TypeError(('Expected a list or tuple, not a %s' % 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(ops.IndexedSlices(o.values, cast(o.indices, dtypes.int64), o.dense_shape))
        else:
            casted_outputs.append(o)
    return casted_outputs
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.
def _as_indexed_slices_list(inputs, optimize=True):
    "Convert all elements of 'inputs' to IndexedSlices.\n\n  Additionally, homogenize the types of all the indices to\n  either int32 or int64.\n\n  Args:\n    inputs: List containing either Tensor or IndexedSlices objects.\n    optimize: if true, attempt to optimize the conversion of each input.\n\n  Returns:\n    A list of IndexedSlices objects.\n\n  Raises:\n    TypeError: If 'inputs' is not a list or a tuple.\n  "
    if (not isinstance(inputs, (list, tuple))):
        raise TypeError(('Expected a list or tuple, not a %s' % 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(ops.IndexedSlices(o.values, cast(o.indices, dtypes.int64), o.dense_shape))
        else:
            casted_outputs.append(o)
    return casted_outputs