class_docstr: Transformer layer.
  
  This layer implements the Transformer from "Attention Is All You Need".
  (https://arxiv.org/abs/1706.03762).
  
  Attributes:
    num_attention_heads: Number of attention heads.
    intermediate_size: Size of the intermediate layer.
    intermediate_activation: Activation for the intermediate layer.
    dropout_rate: Dropout probability for the post-attention and output dropout.
    attention_dropout_rate: Dropout probability for within the attention layer.
    kernel_initializer: Initializer for dense layer kernels.
    bias_initializer: Initializer for dense layer biases.
    kernel_regularizer: Regularizer for dense layer kernels.
    bias_regularizer: Regularizer for dense layer biases.
    activity_regularizer: Regularizer for dense layer activity.
    kernel_constraint: Constraint for dense layer kernels.
    bias_constraint: Constraint for dense layer kernels.
class_docstr_tok: ["Transformer","layer",".","This","layer","implements","the","Transformer","from","``","Attention","Is","All","You","Need","''",".","(","https",":","\/\/arxiv.org\/abs\/1706.03762",")",".","Attributes",":","num_attention_heads",":","Number","of","attention","heads",".","intermediate_size",":","Size","of","the","intermediate","layer",".","intermediate_activation",":","Activation","for","the","intermediate","layer",".","dropout_rate",":","Dropout","probability","for","the","post-attention","and","output","dropout",".","attention_dropout_rate",":","Dropout","probability","for","within","the","attention","layer",".","kernel_initializer",":","Initializer","for","dense","layer","kernels",".","bias_initializer",":","Initializer","for","dense","layer","biases",".","kernel_regularizer",":","Regularizer","for","dense","layer","kernels",".","bias_regularizer",":","Regularizer","for","dense","layer","biases",".","activity_regularizer",":","Regularizer","for","dense","layer","activity",".","kernel_constraint",":","Constraint","for","dense","layer","kernels",".","bias_constraint",":","Constraint","for","dense","layer","kernels","."]
code: def compute_output_shape(self, input_shape):
      data_tensor_shape = tf.TensorShape(input_shape[0])
      batch = data_tensor_shape[0]
      sequence_length = data_tensor_shape[1]
  
      return tf.TensorShape(
          (batch, sequence_length, self._output_einsum_shape)
      )
  
file_path: autodist/examples/benchmark/utils/modeling/layers/transformer.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from utils.modeling.layers import attention
  from utils.modeling.layers import dense_einsum
label_desc: Use image node_id 3 for calling the Transformer obj's underlying member method code with example usage: obj.compute_output_shape(input_shape) and returns: tf