View source on GitHub |
Utility tf.function
that converts a padded tensor to ragged.
@tf.function
tfq.padded_to_ragged( masked_state )
Convert a state tf.Tensor
padded with the value -2 to a tf.RaggedTensor
using efficient boolean masking.
Args | |
---|---|
masked_state
|
tf.State tensor with -2 padding.
|
Returns | |
---|---|
state_ragged
|
State tensor without padding as a tf.RaggedTensor .
|