espnet.nets.pytorch_backend.rnn.attentions.att_for
Less than 1 minute
espnet.nets.pytorch_backend.rnn.attentions.att_for
espnet.nets.pytorch_backend.rnn.attentions.att_for(args, num_att=1, han_mode=False)
Instantiates an attention module given the program arguments
- Parameters:
- args (Namespace) – The arguments
- num_att (int) – number of attention modules (in multi-speaker case, it can be 2 or more)
- han_mode (bool) – switch on/off mode of hierarchical attention network (HAN)
:rtype torch.nn.Module :return: The attention module