tf.ragged.map_flat_values

Applies op to the flat_values of one or more RaggedTensors.

Used in the notebooks

Used in the guide

Replaces any RaggedTensor in args or kwargs with its flat_values tensor (which collapses all ragged dimensions), and then calls op. Returns a RaggedTensor that is constructed from the input RaggedTensors' nested_row_splits and the value returned by the op.

If the input arguments contain multiple RaggedTensors, then they must have identical nested_row_splits.

This operation is generally used to apply elementwise operations to each value in a RaggedTensor.