docstr: Calcualte weights for ``num_inputs`` variables  which are each of size ``input_size``
code: def __init__(
      self,
      input_sizes: Dict[str, int],
      hidden_size: int,
      input_embedding_flags: Dict[str, bool] = {},
      dropout: float = 0.1,
      context_size: int = None,
      single_variable_grns: Dict[str, GatedResidualNetwork] = {},
      prescalers: Dict[str, nn.Linear] = {},
  ):
      """
      Calcualte weights for ``num_inputs`` variables  which are each of size ``input_size``
      """
      super().__init__()
  
      self.hidden_size = hidden_size
      self.input_sizes = input_sizes
      self.input_embedding_flags = input_embedding_flags
      self.dropout = dropout
      self.context_size = context_size
  
      if self.num_inputs > 1:
          if self.context_size is not None:
              self.flattened_grn = GatedResidualNetwork(
                  self.input_size_total,
                  min(self.hidden_size, self.num_inputs),
                  self.num_inputs,
                  self.dropout,
                  self.context_size,
                  residual=False,
              )
          else:
              self.flattened_grn = GatedResidualNetwork(
                  self.input_size_total,
                  min(self.hidden_size, self.num_inputs),
                  self.num_inputs,
                  self.dropout,
                  residual=False,
              )
  
      self.single_variable_grns = nn.ModuleDict()
      self.prescalers = nn.ModuleDict()
      for name, input_size in self.input_sizes.items():
          if name in single_variable_grns:
              self.single_variable_grns[name] = single_variable_grns[
                  name
              ]
          elif self.input_embedding_flags.get(name, False):
              self.single_variable_grns[name] = ResampleNorm(
                  input_size, self.hidden_size
              )
          else:
              self.single_variable_grns[name] = GatedResidualNetwork(
                  input_size,
                  min(input_size, self.hidden_size),
                  output_size=self.hidden_size,
                  dropout=self.dropout,
              )
          if name in prescalers:  # reals need to be first scaled up
              self.prescalers[name] = prescalers[name]
          elif not self.input_embedding_flags.get(name, False):
              self.prescalers[name] = nn.Linear(1, input_size)
  
      self.softmax = nn.Softmax(dim=-1)
  
imports: import math
  from typing import Dict, List, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new VariableSelectionNetwork object from inherited base classes: nn with example: obj = VariableSelectionNetwork(input_sizes, hidden_size, input_embedding_flags, dropout, context_size, single_variable_grns, prescalers)