code: def _apply_layer_norm(input_tensor, nonpadding, hparams):
      """Applies Tensor2Tensor layer_norm to |input_tensor|."""
      input_depth = input_tensor.shape.as_list()[-1]
      if nonpadding is not None:
          nonpadding_input_tiled = tf.tile(
              tf.expand_dims(nonpadding, 2), [1, 1, input_depth]
          )
          output_tensor = input_tensor * nonpadding_input_tiled
  
      output_tensor = common_layers.layer_preprocess(
          input_tensor, hparams
      )
      if nonpadding is not None:
          output_tensor *= nonpadding_input_tiled
  
      return output_tensor
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import six
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.models import transformer
  from tensor2tensor.models.neural_architecture_search import nas_layers
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import metrics
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 4 for calling a global function with example usage: _apply_layer_norm(input_tensor, nonpadding, hparams) and returns: output_tensor