tf.IndexedSlices

View source on GitHub

A sparse representation of a set of tensor slices at given indices.

tf.IndexedSlices(
    values, indices, dense_shape=None
)

This class is a simple wrapper for a pair of Tensor objects:

An IndexedSlices is typically used to represent a subset of a larger tensor dense of shape [LARGE0, D1, .. , DN] where LARGE0 >> D0. The values in indices are the indices in the first dimension of the slices that have been extracted from the larger tensor.

The dense tensor dense represented by an IndexedSlices slices has

dense[slices.indices[i], :, :, :, ...] = slices.values[i, :, :, :, ...]

The IndexedSlices class is used principally in the definition of gradients for operations that have sparse gradients (e.g. tf.gather).

Contrast this representation with tf.SparseTensor, which uses multi-dimensional indices and scalar values.

Attributes:

Methods

__neg__

View source

__neg__()

consumers

View source

consumers()