espnet2.lid.conditioned_layer.Lang2VecConditionedLayer
espnet2.lid.conditioned_layer.Lang2VecConditionedLayer
class espnet2.lid.conditioned_layer.Lang2VecConditionedLayer(layer, encoder, pooling, projector, prediction, conditioning_layer=None, detach_prediction=False, detach_condition=False)
Bases: Module
Predict lang2vec after an upstream layer and add its projected residual.
The original layer owns attention and checkpointing. The LID model consumes intermediate_out for the auxiliary loss and clears it after each call. As with self-conditioned interCTC, the model creates the projection, which may be shared across several wrappers.
Initialize internal Module state, shared by both nn.Module and ScriptModule.
forward(hidden_states, attention_mask=None, output_attentions=False, **kwargs)
Preserve the upstream output tuple and pass attention arguments through.
