class_docstr: Output layer for multilabel sequence classification models.
  
  Args:
      outputs (Dict[str, ClassificationOutputLayer]): Output for multilabels
      optional label_weights (Dict[str, int]): Dict of label_names along with the
      weight for label
docstr: Compute and return the averaged intent and slot-filling loss.
  
  Args:
      logits (List[torch.Tensor]): Logits returned by
          :class:`~pytext.models.decoders.MultiLabelDecoder`. It's list
          containing logits for all label tasks here pTSR, autoUSM and EA.
      targets (List[torch.Tensor]): Targets as computed by the true labels
      context (Optional[torch.Tensor]): Not applicable. Defaults to None.
  
  Returns:
      torch.Tensor: Averaged Loss across all label losses.
docstr_tok: ["Compute","and","return","the","averaged","intent","and","slot-filling","loss",".","Args",":","logits","(","List","[","torch.Tensor","]",")",":","Logits","returned","by",":","class",":","`","~pytext.models.decoders.MultiLabelDecoder","`",".","It","'s","list","containing","logits","for","all","label","tasks","here","pTSR",",","autoUSM","and","EA",".","targets","(","List","[","torch.Tensor","]",")",":","Targets","as","computed","by","the","true","labels","context","(","Optional","[","torch.Tensor","]",")",":","Not","applicable",".","Defaults","to","None",".","Returns",":","torch.Tensor",":","Averaged","Loss","across","all","label","losses","."]
code: def get_loss(
      self,
      logits,
      targets: List[torch.Tensor],
      context: Optional[Dict[str, Any]] = None,
      *args,
      **kwargs,
  ) -> torch.Tensor:
      """Compute and return the averaged intent and slot-filling loss.
  
      Args:
          logits (List[torch.Tensor]): Logits returned by
              :class:`~pytext.models.decoders.MultiLabelDecoder`. It's list
              containing logits for all label tasks here pTSR, autoUSM and EA.
          targets (List[torch.Tensor]): Targets as computed by the true labels
          context (Optional[torch.Tensor]): Not applicable. Defaults to None.
  
      Returns:
          torch.Tensor: Averaged Loss across all label losses.
      """
      total_loss = 0
      for logit, target, (label_name, output_layer) in zip(
          logits, targets, self.outputs.items()
      ):
          # flatten from [batch_size, ..., label_set_size] to
          # [batch_size, label_set_size]
          flattened_logit = logit.view(-1, logit.size()[-1])
          loss = output_layer.get_loss(flattened_logit, target.view(-1))
          if label_name in self.label_set_weights:
              weight = self.label_set_weights[label_name]
              loss = torch.mul(loss, weight)
          total_loss += loss
      return total_loss / (self.num_label_sets * 1.0)
  
imports: import functools
  import operator
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from caffe2.python import core
  from pytext.data.tensorizers import Tensorizer
  from pytext.utils.usage import log_class_usage
  from torch import jit
  from .doc_classification_output_layer import ClassificationOutputLayer
  from .output_layer_base import OutputLayerBase
label_desc: Use image node_id 3 for calling the MultiLabelClassificationLayer obj's underlying member method code with example usage: obj.get_loss(logits, targets, context) and returns: unknown