VarLenTensorValue encapsulates a batch of varlen dense tensor values.
tfma.types.VarLenTensorValue(
values: np.ndarray, indices: np.ndarray, dense_shape: np.ndarray
)
Attributes |
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
dense_rows()
from_dense_rows
View source
@classmethod
from_dense_rows(
dense_rows: Iterable[np.ndarray]
) -> 'VarLenTensorValue'
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).
|