TFOpenFst

This provides ops as wrappers around OpenFst.

TFOpenFst.get_fst(filename)[source]
Parameters:filename (str) – to OpenFst file
Returns:TF resource handle representing the FST
Return type:tf.Tensor
TFOpenFst.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)

TFOpenFst.openfst_checked_out()[source]
TFOpenFst.get_tf_mod(verbose=False)[source]
Parameters:verbose (bool) –
Returns:module