class pytorch_forecasting.models.temporal_fusion_transformer.sub_modules.InterpretableMultiHeadAttention(n_head: int, d_model: int, dropout: float = 0.0)[source]#

Bases: Module

Initializes internal Module state, shared by both nn.Module and ScriptModule.


forward(q, k, v[, mask])

Defines the computation performed at every call.


forward(q, k, v, mask=None) Tuple[Tensor, Tensor][source]#

Defines the computation performed at every call.

Should be overridden by all subclasses.


Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.