code: def dense(name, x, n_out, dtype=tf.float32, init_w=0.05):
      """Dense layer."""
      n_in = common_layers.shape_list(x)[2]
      with tf.variable_scope(name, reuse=tf.AUTO_REUSE):
          w = tf.get_variable(
              "w",
              [n_in, n_out],
              dtype,
              initializer=tf.random_normal_initializer(0.0, init_w),
              trainable=True,
          )
          b = tf.get_variable(
              "b",
              [
                  n_out,
              ],
              dtype,
              initializer=tf.zeros_initializer,
              trainable=True,
          )
          x = tf.matmul(x, w) + b
          return x
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import math
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.models.transformer import transformer_decoder_layer
  import tensorflow.compat.v1
  import tensorflow_probability
label_desc: Use image node_id 1 for calling a global function with example usage: dense(name, x, n_out, dtype, init_w) and returns: x