Stay organized with collections Save and categorize content based on your preferences.

VarLenTensorValue encapsulates a batch of varlen dense tensor values.

values A np.ndarray of values.
indices A np.ndarray of indices.
dense_shape A np.ndarray representing the dense shape of the entire tensor. Note that each row (i.e. set of values sharing the same value for the first / batch dimension) is considered to have its own shape based on the presence of values.

Child Classes

class DenseRowIterator



View source


View source

Converts a collection of variable length dense arrays into a tensor.

dense_rows A sequence of possibly variable length 1D arrays.

A new VarLenTensorValue containing the sparse representation of the vertically stacked dense rows. The dense_shape attribute on the result will be (num_rows, max_row_len).