returnn.tf.util.open_fst

This provides ops as wrappers around OpenFst.

returnn.tf.util.open_fst.get_fst(filename)[source]
Parameters:

filename (str) – to OpenFst file

Returns:

TF resource handle representing the FST

Return type:

tf.Tensor

returnn.tf.util.open_fst.fst_transition(fst_handle, states, inputs)[source]
Parameters:
  • fst_handle (tf.Tensor) – via get_fst()

  • states (tf.Tensor) – [batch], int32

  • inputs (tf.Tensor) – [batch], int32

Returns:

(next_states, output_labels, weights). next_states can be -1 if invalid. all are shape [batch].

Return type:

(tf.Tensor,tf.Tensor,tf.Tensor)

returnn.tf.util.open_fst.openfst_checked_out()[source]
Returns:

whether the Git submodule is checked out

Return type:

bool

returnn.tf.util.open_fst.get_tf_mod(verbose=False)[source]
Parameters:

verbose (bool)

Returns:

module