terminator.models.layers.s2s_modules.NodeTransformerLayer¶
- class terminator.models.layers.s2s_modules.NodeTransformerLayer(num_hidden, num_in, num_heads=4, dropout=0.1)[source]¶
Bases:
Module- __init__(num_hidden, num_in, num_heads=4, dropout=0.1)[source]¶
Initializes internal Module state, shared by both nn.Module and ScriptModule.
Methods
__init__(num_hidden, num_in[, num_heads, ...])Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(h_V, h_E[, mask_V, mask_attend])Parallel computation of full transformer layer
step(t, h_V, h_E[, mask_V, mask_attend])Sequential computation of step t of a transformer layer
Attributes
T_destinationalias of TypeVar('T_destination', bound=
Mapping[str,Tensor])dump_patchesThis allows better BC support for
load_state_dict().