def divide_by_n_tensors_or_indexed_slices(value, n):
    if isinstance(value, ops.IndexedSlices):
        value = gradients_impl._HandleNestedIndexedSlices(value)
        return ops.IndexedSlices((value.values / n), value.indices, value.dense_shape)
    else:
        return (value / n)
def divide_by_n_tensors_or_indexed_slices(value, n):
    if isinstance(value, ops.IndexedSlices):
        value = gradients_impl._HandleNestedIndexedSlices(value)
        return ops.IndexedSlices((value.values / n), value.indices, value.dense_shape)
    else:
        return (value / n)