code: def default_transformer_poswise_net_hparams(output_dim=512):
      """Returns default hyperparameters of a
      :class:`~texar.tf.modules.FeedForwardNetwork` as a pos-wise network used
      in :class:`~texar.tf.modules.TransformerEncoder` and
      :class:`~texar.tf.modules.TransformerDecoder`.
  
      This is a 2-layer dense network with dropout in-between.
  
      .. code-block:: python
  
          {
              "layers": [
                  {
                      "type": "Dense",
                      "kwargs": {
                          "name": "conv1",
                          "units": output_dim*4,
                          "activation": "relu",
                          "use_bias": True,
                      }
                  },
                  {
                      "type": "Dropout",
                      "kwargs": {
                          "rate": 0.1,
                      }
                  },
                  {
                      "type": "Dense",
                      "kwargs": {
                          "name": "conv2",
                          "units": output_dim,
                          "use_bias": True,
                      }
                  }
              ],
              "name": "ffn"
          }
  
      Args:
          output_dim (int): The size of output dense layer.
      """
      return {
          "layers": [
              {
                  "type": "Dense",
                  "kwargs": {
                      "name": "conv1",
                      "units": output_dim * 4,
                      "activation": "relu",
                      "use_bias": True,
                  },
              },
              {
                  "type": "Dropout",
                  "kwargs": {
                      "rate": 0.1,
                  },
              },
              {
                  "type": "Dense",
                  "kwargs": {
                      "name": "conv2",
                      "units": output_dim,
                      "use_bias": True,
                  },
              },
          ],
          "name": "ffn",
      }
  
file_path: texar/texar/tf/modules/encoders/transformer_encoders.py
imports: import tensorflow
  from texar.tf.core import layers
  from texar.tf.utils import transformer_attentions, transformer_utils
  from texar.tf.modules.encoders.encoder_base import EncoderBase
  from texar.tf.modules.encoders.multihead_attention import MultiheadAttentionEncoder
  from texar.tf.modules.networks.networks import FeedForwardNetwork
  from texar.tf.utils.shapes import shape_list
  from texar.tf.utils.mode import is_train_mode
label_desc: Use image node_id 1 for calling a global function with example usage: default_transformer_poswise_net_hparams(output_dim) and returns: dict