description: The value of a leaf node.
View source on GitHub
|
The value of a leaf node.
s2t.LeafNodeTensor(
parent_index: tf.Tensor,
values: tf.Tensor,
is_repeated: bool
)
| `parent_index` | a 1-D int64 tensor where parent_index[i] represents the parent index of values[i] |
| `values` | a 1-D tensor of equal length to parent_index. |
| `is_repeated` | a bool indicating if there can be more than one child per parent. |
| `is_repeated` | |
| `parent_index` | |
| `values` | |
get_positional_index() -> tf.Tensor
Gets the positional index for this LeafNodeTensor.
The positional index tells us which index of the parent an element is.
For example, with the following parent indices: [0, 0, 2] we would have positional index: [ 0, # The 0th element of the 0th parent. 1, # The 1st element of the 0th parent. 0 # The 0th element of the 2nd parent. ].
For more information, view ops/run_length_before_op.cc
This is the same for Child NodeTensors.
| Returns | |
|---|---|
| A tensor of positional indices. |
View source on GitHub