LostTech.TensorFlow : API Documentation

Type IndexedSlices

Namespace tensorflow

Parent PythonObjectContainer

Interfaces _TensorLike, CompositeTensor, IIndexedSlices

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

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

* `values`: A `Tensor` of any dtype with shape `[D0, D1,..., Dn]`. * `indices`: A 1-D integer `Tensor` with shape `[D0]`.

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 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.
Show Example
dense[slices.indices[i], :, :, :,...] = slices.values[i, :, :, :,...] 

Methods

Properties

Public instance methods

object __neg__()

object __neg___dyn()

IList<object> consumers()

Returns a list of `Operation`s that consume this tensor.
Returns
IList<object>
A list of `Operation`s.

object consumers_dyn()

Returns a list of `Operation`s that consume this tensor.
Returns
object
A list of `Operation`s.

Public properties

object dense_shape get;

A 1-D `Tensor` containing the shape of the corresponding dense tensor.

object dense_shape_dyn get;

A 1-D `Tensor` containing the shape of the corresponding dense tensor.

object device get;

The name of the device on which `values` will be produced, or `None`.

object device_dyn get;

The name of the device on which `values` will be produced, or `None`.

object dtype get;

The `DType` of elements in this tensor.

object dtype_dyn get;

The `DType` of elements in this tensor.

object graph get;

The `Graph` that contains the values, indices, and shape tensors.

object graph_dyn get;

The `Graph` that contains the values, indices, and shape tensors.

object indices get;

A 1-D `Tensor` containing the indices of the slices.

object indices_dyn get;

A 1-D `Tensor` containing the indices of the slices.

object name get;

The name of this `IndexedSlices`.

object name_dyn get;

The name of this `IndexedSlices`.

object op get;

The `Operation` that produces `values` as an output.

object op_dyn get;

The `Operation` that produces `values` as an output.

object PythonObject get;

object values get;

A `Tensor` containing the values of the slices.

object values_dyn get;

A `Tensor` containing the values of the slices.