class_docstr: BERT model ("Bidirectional Encoder Representations from Transformers").
class_docstr_tok: ["BERT","model","(","``","Bidirectional","Encoder","Representations","from","Transformers","''",")","."]
code: def feedforward(self, x):
      intermediate = mtf.layers.dense(
          x,
          reduced_dims=[self.model_dim],
          new_dims=[self.feedforward_intermediate_dim],
          activation=get_activation(
              self.config.feedforward_intermediate_act
          ),
          kernel_initializer=self.dense_initializer,
          name="dense_1",
          use_bias=self.config.use_bias,
      )
      return mtf.layers.dense(
          intermediate,
          reduced_dims=[self.feedforward_intermediate_dim],
          new_dims=[self.model_dim],
          kernel_initializer=self.dense_initializer,
          name="dense_2",
          use_bias=self.config.use_bias,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import copy
  import json
  import math
  import re
  import mesh_tensorflow
  import mesh_tensorflow.transformer.moe
  import six
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the BertModel obj's underlying member method code with example usage: obj.feedforward(x) and returns: mtf