class_docstr: Bi-directional Transformer-based encoder network.
  
  This network implements a bi-directional Transformer-based encoder as
  described in "BERT: Pre-training of Deep Bidirectional Transformers for
  Language Understanding" (https://arxiv.org/abs/1810.04805). It includes the
  embedding lookups and transformer layers, but not the masked language model
  or classification task networks.
  
  The default values for this object are taken from the BERT-Base implementation
  in "BERT: Pre-training of Deep Bidirectional Transformers for Language
  Understanding".
  
  Attributes:
    vocab_size: The size of the token vocabulary.
    hidden_size: The size of the transformer hidden layers.
    num_layers: The number of transformer layers.
    num_attention_heads: The number of attention heads for each transformer. The
      hidden size must be divisible by the number of attention heads.
    sequence_length: The sequence length that this encoder expects. If None, the
      sequence length is dynamic; if an integer, the encoder will require
      sequences padded to this length.
    max_sequence_length: The maximum sequence length that this encoder can
      consume. If None, max_sequence_length uses the value from sequence length.
      This determines the variable shape for positional embeddings.
    type_vocab_size: The number of types that the 'type_ids' input can take.
    intermediate_size: The intermediate size for the transformer layers.
    activation: The activation to use for the transformer layers.
    dropout_rate: The dropout rate to use for the transformer layers.
    attention_dropout_rate: The dropout rate to use for the attention layers
      within the transformer layers.
    initializer: The initialzer to use for all weights in this encoder.
    float_dtype: The dtype of this encoder. Can be 'float32' or 'float16'.
class_docstr_tok: ["Bi-directional","Transformer-based","encoder","network",".","This","network","implements","a","bi-directional","Transformer-based","encoder","as","described","in","``","BERT",":","Pre-training","of","Deep","Bidirectional","Transformers","for","Language","Understanding","''","(","https",":","\/\/arxiv.org\/abs\/1810.04805",")",".","It","includes","the","embedding","lookups","and","transformer","layers",",","but","not","the","masked","language","model","or","classification","task","networks",".","The","default","values","for","this","object","are","taken","from","the","BERT-Base","implementation","in","``","BERT",":","Pre-training","of","Deep","Bidirectional","Transformers","for","Language","Understanding","''",".","Attributes",":","vocab_size",":","The","size","of","the","token","vocabulary",".","hidden_size",":","The","size","of","the","transformer","hidden","layers",".","num_layers",":","The","number","of","transformer","layers",".","num_attention_heads",":","The","number","of","attention","heads","for","each","transformer",".","The","hidden","size","must","be","divisible","by","the","number","of","attention","heads",".","sequence_length",":","The","sequence","length","that","this","encoder","expects",".","If","None",",","the","sequence","length","is","dynamic",";","if","an","integer",",","the","encoder","will","require","sequences","padded","to","this","length",".","max_sequence_length",":","The","maximum","sequence","length","that","this","encoder","can","consume",".","If","None",",","max_sequence_length","uses","the","value","from","sequence","length",".","This","determines","the","variable","shape","for","positional","embeddings",".","type_vocab_size",":","The","number","of","types","that","the","'type_ids","'","input","can","take",".","intermediate_size",":","The","intermediate","size","for","the","transformer","layers",".","activation",":","The","activation","to","use","for","the","transformer","layers",".","dropout_rate",":","The","dropout","rate","to","use","for","the","transformer","layers",".","attention_dropout_rate",":","The","dropout","rate","to","use","for","the","attention","layers","within","the","transformer","layers",".","initializer",":","The","initialzer","to","use","for","all","weights","in","this","encoder",".","float_dtype",":","The","dtype","of","this","encoder",".","Can","be","'float32","'","or","'float16","'","."]
code: def get_embedding_table(self):
      return self._embedding_layer.embeddings
  
file_path: autodist/examples/benchmark/utils/modeling/networks/transformer_encoder.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tensorflow.python.keras.engine import network
  from utils import activations
  from utils import bert_modeling
  from utils.modeling import layers
label_desc: Use image node_id 2 for calling the TransformerEncoder obj's underlying member method code with example usage: obj.get_embedding_table() and returns: self