class_docstr: Output layer for joint intent classification and slot-filling models.
  Intent classification is a document classification problem and slot filling
  is a word tagging problem. Thus terms these can be used interchangeably in the
  documentation.
  
  Args:
      doc_output (ClassificationOutputLayer): Output layer for intent
          classification task. See
          :class:`~pytext.models.output_layers.ClassificationOutputLayer` for
          details.
      word_output (WordTaggingOutputLayer): Output layer for slot filling task.
          See :class:`~pytext.models.output_layers.WordTaggingOutputLayer` for
          details.
  
  Attributes:
      doc_output (type): Output layer for intent classification task.
      word_output (type): Output layer for slot filling task.
docstr: Compute and return the averaged intent and slot-filling loss.
  
  Args:
      logit (Tuple[torch.Tensor, torch.Tensor]): Logits returned by
          :class:`~pytext.models.joint_model.JointModel`. It is a tuple
          containing logits for intent classification and slot filling.
      targets (Tuple[torch.Tensor, torch.Tensor]): Tuple of target Tensors
          containing true document label/target and true word labels/targets.
      context (Dict[str, Any]): Context is a dictionary of items
          that's passed as additional metadata. Defaults to None.
  
  Returns:
      torch.Tensor: Averaged intent and slot loss.
docstr_tok: ["Compute","and","return","the","averaged","intent","and","slot-filling","loss",".","Args",":","logit","(","Tuple","[","torch.Tensor",",","torch.Tensor","]",")",":","Logits","returned","by",":","class",":","`","~pytext.models.joint_model.JointModel","`",".","It","is","a","tuple","containing","logits","for","intent","classification","and","slot","filling",".","targets","(","Tuple","[","torch.Tensor",",","torch.Tensor","]",")",":","Tuple","of","target","Tensors","containing","true","document","label\/target","and","true","word","labels\/targets",".","context","(","Dict","[","str",",","Any","]",")",":","Context","is","a","dictionary","of","items","that","'s","passed","as","additional","metadata",".","Defaults","to","None",".","Returns",":","torch.Tensor",":","Averaged","intent","and","slot","loss","."]
code: def get_loss(
      self,
      logits: Tuple[torch.Tensor, torch.Tensor],
      targets: Tuple[torch.Tensor, torch.Tensor],
      context: Dict[str, Any] = None,
      *args,
      **kwargs,
  ) -> torch.Tensor:
      """Compute and return the averaged intent and slot-filling loss.
  
      Args:
          logit (Tuple[torch.Tensor, torch.Tensor]): Logits returned by
              :class:`~pytext.models.joint_model.JointModel`. It is a tuple
              containing logits for intent classification and slot filling.
          targets (Tuple[torch.Tensor, torch.Tensor]): Tuple of target Tensors
              containing true document label/target and true word labels/targets.
          context (Dict[str, Any]): Context is a dictionary of items
              that's passed as additional metadata. Defaults to None.
  
      Returns:
          torch.Tensor: Averaged intent and slot loss.
  
      """
      d_logit, w_logit = logits
      if DatasetFieldName.TOKEN_INDICES in context:
          w_logit = query_word_reprs(
              w_logit, context[DatasetFieldName.TOKEN_INDICES]
          )
      d_target, w_target = targets
      d_weight = context[DatasetFieldName.DOC_WEIGHT_FIELD]  # noqa
      w_weight = context[DatasetFieldName.WORD_WEIGHT_FIELD]  # noqa
      d_loss = self.doc_output.get_loss(
          d_logit, d_target, context=context, reduce=False
      )
      w_loss = self.word_output.get_loss(
          w_logit, w_target, context=context, reduce=False
      )
      # w_loss could have been flattened
      w_hard_target = (
          w_target[0] if type(w_target) is tuple else w_target
      )
      if w_loss.size()[0] != w_hard_target.size()[0]:
          w_loss = w_loss.reshape(w_hard_target.size())
          w_loss = torch.mean(w_loss, dim=1)
      d_weighted_loss = torch.mean(torch.mul(d_loss, d_weight))
      w_weighted_loss = torch.mean(torch.mul(w_loss, w_weight))
      return d_weighted_loss + w_weighted_loss
  
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from caffe2.python import core
  from pytext.common.constants import DatasetFieldName
  from pytext.data.utils import Vocabulary
  from pytext.models.module import create_module
  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
  from .utils import query_word_reprs
  from .word_tagging_output_layer import CRFOutputLayer, WordTaggingOutputLayer
label_desc: Use image node_id 3 for calling the IntentSlotOutputLayer obj's underlying member method code with example usage: obj.get_loss(logits, targets, context) and returns: unknown