code: def add_pos_signals(x, hparams, name="pos_emb"):
      with tf.variable_scope(name, reuse=False):
          if hparams.pos == "timing":
              x = common_attention.add_timing_signal_nd(x)
          else:
              assert hparams.pos == "emb"
              x = common_attention.add_positional_embedding_nd(
                  x, hparams.max_length, name
              )
      return x
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from six.moves import range
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import expert_utils
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 20 for calling a global function with example usage: add_pos_signals(x, hparams, name) and returns: x