tf.sparse_mask( a, mask_indices, name=None )
See the guide: Variables > Sparse Variable Updates
Masks elements of
a, returns another
contains a subset of the slices of
a. Only the slices at indices not
mask_indices are returned.
This is useful when you need to extract a subset of slices in an
.html# `a` contains slices at indices [12, 26, 37, 45] from a large tensor .html# with shape [1000, 10] a.indices .html# [12, 26, 37, 45] tf.shape(a.values) .html# [4, 10] .html# `b` will be the subset of `a` slices at its second and third indices, so .html# we want to mask its first and last indices (which are at absolute .html# indices 12, 45) b = tf.sparse_mask(a, [12, 45]) b.indices .html# [26, 37] tf.shape(b.values) .html# [2, 10]
mask_indices: Indices of elements to mask.
name: A name for the operation (optional).