class_docstr: Ensemble class that uses bagging for ensembling intent-slot models.
  
  Args:
      config (Config): Configuration object specifying all the
          parameters of BaggingIntentSlotEnsemble.
      models (List[Model]): List of intent-slot model objects.
  
  Attributes:
      use_crf (bool): Whether to use CRF for word tagging task.
      output_layer (IntentSlotOutputLayer): Output layer of intent-slot
          model responsible for computing loss and predictions.
docstr: Call `forward()` method of each intent-slot sub-model by passing all
  arguments and named arguments to the sub-models, collect the logits from
  them and average their values.
  
  Returns:
      torch.Tensor: Logits from the ensemble.
docstr_tok: ["Call","`","forward","(",")","`","method","of","each","intent-slot","sub-model","by","passing","all","arguments","and","named","arguments","to","the","sub-models",",","collect","the","logits","from","them","and","average","their","values",".","Returns",":","torch.Tensor",":","Logits","from","the","ensemble","."]
code: def forward(
      self, *args, **kwargs
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """Call `forward()` method of each intent-slot sub-model by passing all
      arguments and named arguments to the sub-models, collect the logits from
      them and average their values.
  
      Returns:
          torch.Tensor: Logits from the ensemble.
  
      """
      logit_d_list, logit_w_list = None, None
      for model in self.models:
          logit_d, logit_w = model.forward(*args, **kwargs)
          logit_d, logit_w = logit_d.unsqueeze(2), logit_w.unsqueeze(3)
  
          if logit_d_list is None:
              logit_d_list = logit_d
          else:
              logit_d_list = torch.cat([logit_d_list, logit_d], dim=2)
  
          if logit_w_list is None:
              logit_w_list = logit_w
          else:
              logit_w_list = torch.cat([logit_w_list, logit_w], dim=3)
  
      return torch.mean(logit_d_list, dim=2), torch.mean(
          logit_w_list, dim=3
      )
  
file_path: pytext/pytext/models/ensembles/bagging_intent_slot_ensemble.py
imports: from typing import Dict, List, Tuple
  import torch
  from pytext.models.joint_model import IntentSlotModel
  from pytext.models.model import Model
  from pytext.models.output_layers import CRFOutputLayer
  from pytext.utils.usage import log_class_usage
  from .ensemble import EnsembleModel
label_desc: Use image node_id 3 for calling the BaggingIntentSlotEnsembleModel obj's underlying member method code with example usage: obj.forward() and returns: torch,  torch