class_docstr: Base class for all output layers in PyText. The responsibilities of this layer are
  
      1. Implement how loss is computed from logits and targets.
      2. Implement how to get predictions from logits.
      3. Implement the Caffe2 operator for performing the above tasks. This is
          used when PyText exports PyTorch model to Caffe2.
  
  Args:
      loss_fn (type): The loss function object to use for computing loss.
          Defaults to None.
  
  Attributes:
      loss_fn: The loss function object to use for computing loss.
docstr: Exports the output layer to Caffe2 by manually adding the necessary operators
  to the init_net and predict_net and, returns the list of external output
  blobs to be added to the model. By default this does nothing, so any
  sub-class must override this method (if necessary).
  
  To learn about Caffe2 computation graphs and why we need two networks,
  `init_net` and `predict_net`/`exec_net` read
  https://caffe2.ai/docs/intro-tutorial#null__nets-and-operators.
  
  Args:
      workspace (core.workspace): Caffe2 `workspace` to use for adding the
          operator. See https://caffe2.ai/docs/workspace.html to learn about
          Caffe2 workspace.
      init_net (core.Net): Caffe2 `init_net` to add the operator to.
      predict_net (core.Net): Caffe2 `predict_net` to add the operator to.
      model_out (torch.Tensor): Output logit Tensor from the model to .
      output_name (str): Name of `model_out` to use in Caffe2 net.
      label_names (List[str]): List of names of the targets/labels to
          expose from the Caffe2 net.
  
  Returns:
      List[core.BlobReference]: List of output blobs that the `output_layer`
          generates.
code: def export_to_caffe2(
      self,
      workspace: core.workspace,
      init_net: core.Net,
      predict_net: core.Net,
      model_out: torch.Tensor,
      output_name: str,
  ) -> List[core.BlobReference]:
      """
      Exports the output layer to Caffe2 by manually adding the necessary operators
      to the init_net and predict_net and, returns the list of external output
      blobs to be added to the model. By default this does nothing, so any
      sub-class must override this method (if necessary).
  
      To learn about Caffe2 computation graphs and why we need two networks,
      `init_net` and `predict_net`/`exec_net` read
      https://caffe2.ai/docs/intro-tutorial#null__nets-and-operators.
  
      Args:
          workspace (core.workspace): Caffe2 `workspace` to use for adding the
              operator. See https://caffe2.ai/docs/workspace.html to learn about
              Caffe2 workspace.
          init_net (core.Net): Caffe2 `init_net` to add the operator to.
          predict_net (core.Net): Caffe2 `predict_net` to add the operator to.
          model_out (torch.Tensor): Output logit Tensor from the model to .
          output_name (str): Name of `model_out` to use in Caffe2 net.
          label_names (List[str]): List of names of the targets/labels to
              expose from the Caffe2 net.
  
      Returns:
          List[core.BlobReference]: List of output blobs that the `output_layer`
              generates.
  
      """
      return []
  
file_path: pytext/pytext/models/output_layers/output_layer_base.py
imports: from typing import Any, Dict, List, Optional, Tuple
  import torch
  from caffe2.python import core
  from pytext.loss import Loss
  from pytext.models.module import Module
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 4 for calling the OutputLayerBase obj's underlying member method code with example usage: obj.export_to_caffe2(workspace, init_net, predict_net, model_out, output_name) and returns: list