class pytorch_forecasting.models.temporal_fusion_transformer.sub_modules.VariableSelectionNetwork(input_sizes: Dict[str, int], hidden_size: int, input_embedding_flags: Dict[str, bool] = {}, dropout: float = 0.1, context_size: int | None = None, single_variable_grns: Dict[str, GatedResidualNetwork] = {}, prescalers: Dict[str, Linear] = {})[source]#

Bases: Module

Calcualte weights for num_inputs variables which are each of size input_size


forward(x[, context])

Defines the computation performed at every call.

forward(x: Dict[str, Tensor], context: Tensor | None = None)[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.