tfma.types.VarLenTensorValue

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

Methods

dense_rows

View source

from_dense_rows

View source

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

Args
dense_rows A sequence of possibly variable length 1D arrays.

Returns
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).