code: def _ffn_layer_multi_inputs(
      inputs_list,
      hparams,
      output_size=None,
      ffn_layer_type="dense",
      name="ffn",
      kernel_initializer=None,
      bias_initializer=None,
      activation=None,
      pad_remover=None,
      preprocess=False,
      postprocess=False,
  ):
      """Implements a Feed-forward layer with multiple inputs, pad-removing, etc.
  
      Args:
        inputs_list: list of input tensors
        hparams: hyper-parameters
        output_size: dimentionality of the output
        ffn_layer_type: dense / dense_dropconnect/ dense_relu_dense
        name: name
        kernel_initializer: kernel initializer
        bias_initializer: bias initializer
        activation: activation function
        pad_remover: pad remover
        preprocess: if preprocess the input --> default: layer-norm
        postprocess: if postprocess the output --> default: drop-out and residual
  
      Returns:
        a tensor
      Raises:
        ValueError: Unknown ffn_layer type.
  
      """
  
      # need at least one inputs
      num_inputs = len(inputs_list)
      assert num_inputs > 0
  
      if preprocess:
          # In case of having more than one input to the ffn,
          # we just apply layer norm on them independently as preprocessing
          for i, inputs in enumerate(inputs_list):
              inputs_list[i] = common_layers.layer_preprocess(
                  inputs_list[i], hparams
              )
  
      # for the residual connection
      if postprocess and num_inputs == 1:
          original_inputs = inputs_list[0]
  
      # the output size is the hidden size of the main inputs
      main_input = inputs_list[0]
      original_shape = common_layers.shape_list(main_input)
      assert (
          hparams.hidden_size
          == common_layers.shape_list(main_input)[-1]
      )
  
      # all the inputs are in the same shape with main inputs
      for inputs in inputs_list:
          main_input.get_shape().assert_is_compatible_with(
              inputs.get_shape()
          )
  
      def remove_pads(x):
          original_shape = common_layers.shape_list(x)
          # Collapse `x` across examples, and remove padding positions.
          x = tf.reshape(
              x, tf.concat([[-1], original_shape[2:]], axis=0)
          )
          x = tf.expand_dims(pad_remover.remove(x), axis=0)
          return x
  
      if pad_remover:
          for i, inputs in enumerate(inputs_list):
              inputs_list[i] = remove_pads(inputs)
  
      ffn_inputs = inputs_list[0]
      if len(inputs_list) != 1:
          ffn_inputs = tf.concat(inputs_list, axis=-1)
  
      if ffn_layer_type == "dense":
          output = common_layers.dense(
              ffn_inputs,
              hparams.hidden_size
              if output_size is None
              else output_size,
              name=name,
              activation=activation,
              use_bias=True,
              kernel_initializer=kernel_initializer,
              bias_initializer=bias_initializer,
          )
  
      elif ffn_layer_type == "dense_dropconnect":
          output = common_layers.dense_dropconnect(
              ffn_inputs,
              hparams.hidden_size
              if output_size is None
              else output_size,
              name=name,
              dropconnect_dropout=hparams.dropconnect_dropout,
              output_activation=activation,
          )
          postprocess = False  # no dropout on the output unit
  
      elif ffn_layer_type == "dense_relu_dense":
          output = common_layers.dense_relu_dense(
              ffn_inputs,
              hparams.filter_size,
              hparams.hidden_size
              if output_size is None
              else output_size,
              name=name,
              dropout=hparams.relu_dropout,
              output_activation=activation,
          )
  
      else:
          raise ValueError(
              "Unknown ffn_layer type: %s" % ffn_layer_type
          )
  
      if pad_remover:
          # Restore `output` to the original shape of `x`, including padding.
          output = tf.reshape(
              pad_remover.restore(tf.squeeze(output, axis=0)),
              original_shape,
          )
  
      if postprocess:
          if num_inputs == 1:
              output = common_layers.layer_postprocess(
                  original_inputs, output, hparams
              )
          else:  # only dropout (no residual)
              hp = copy.copy(hparams)
              hp.layer_postprocess_sequence = (
                  hp.layer_postprocess_sequence.replace("a", "")
              )
              output = common_layers.layer_postprocess(None, output, hp)
  
      return output
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import functools
  from six.moves import range
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import expert_utils
  import tensorflow.compat.v1
label_desc: Use image node_id 16 for calling a global function with example usage: _ffn_layer_multi_inputs(inputs_list, hparams, output_size, ffn_layer_type, name, kernel_initializer, bias_initializer, activation, pad_remover, preprocess, postprocess) and returns: output, x