Skip to content

Latest commit

 

History

History
134 lines (99 loc) · 2.71 KB

File metadata and controls

134 lines (99 loc) · 2.71 KB

description: The value of an intermediate node.

s2t.ChildNodeTensor

View source on GitHub

The value of an intermediate node.

s2t.ChildNodeTensor(
    parent_index: tf.Tensor,
    is_repeated: bool
)

Args

`parent_index` a 1-D int64 tensor where parent_index[i] represents the parent index of the ith child.
`is_repeated` a bool indicating if there can be more than one child per parent.

Attributes

`is_repeated`
`parent_index`
`size` Returns the size, as if this was the root prensor.

Methods

get_positional_index

View source

get_positional_index() -> tf.Tensor

Gets the positional index for this ChildNodeTensor.

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 Leaf NodeTensors.

Returns
A tensor of positional indices.