class_docstr: Torchscriptable version of `BertEncoder` from Huggingface transformers v2.3.0
  https://github.com/huggingface/transformers/blob/v2.3.0/transformers/modeling_bert.py # noqa
  
  Modifies the `forward` function as well as uses scriptable `BertLayerJit`
  
  Changes to `forward` function::
      Typed inputs and modifies the output to be of Tuple[Tensor] type in scripting
      mode. Due to different possible types when `output_hidden_states` or
      `output_attentions` are enable, we do not support these in scripting mode
class_docstr_tok: ["Torchscriptable","version","of","`","BertEncoder","`","from","Huggingface","transformers","v2.3.0","https",":","\/\/github.com\/huggingface\/transformers\/blob\/v2.3.0\/transformers\/modeling_bert.py","#","noqa","Modifies","the","`","forward","`","function","as","well","as","uses","scriptable","`","BertLayerJit","`","Changes","to","`","forward","`","function",":",":","Typed","inputs","and","modifies","the","output","to","be","of","Tuple","[","Tensor","]","type","in","scripting","mode",".","Due","to","different","possible","types","when","`","output_hidden_states","`","or","`","output_attentions","`","are","enable",",","we","do","not","support","these","in","scripting","mode"]
code: def __init__(self, config):
      super().__init__(config)
      self.output_attentions = config.output_attentions
      self.output_hidden_states = config.output_hidden_states
      self.layer = nn.ModuleList(
          [
              BertLayerJit(config)
              for _ in range(config.num_hidden_layers)
          ]
      )
  
imports: import math
  from typing import List, Optional, Tuple
  import torch
  from mmf.utils.patch import restore_saved_modules, safecopy_modules
  from torch import nn, Tensor
label_desc: Use image node_id 1 to create a new BertEncoderJit object from inherited base classes: BertEncoder with example: obj = BertEncoderJit(config)