class_docstr: Creates a positional embedding.
  
  This layer creates a positional embedding as described in "BERT: Pre-training
  of Deep Bidirectional Transformers for Language Understanding"
  (https://arxiv.org/abs/1810.04805).
  
  This layer can be set up to either create a statically shaped slice or a
  dynamically shaped slice. If `use_dynamic_slicing` is True, the input tensor
  can have a dynamic 1st dimension, while if `use_dynamic_slicing` is False the
  input size must be fixed.
  
  Attributes:
    use_dynamic_slicing: Whether to use the dynamic slicing path.
    max_sequence_length: The maximum size of the dynamic sequence. Only
      applicable if `use_dynamic_slicing` is True.
    initializer: The initializer to use for the embedding weights. Defaults to
      "glorot_uniform".
docstr: Implements call() for the layer.
docstr_tok: ["Implements","call","(",")","for","the","layer","."]
code: def call(self, inputs):
      """Implements call() for the layer."""
      if self._use_dynamic_slicing:
          input_shape = tf_utils.get_shape_list(inputs, expected_rank=3)
          seq_length = input_shape[1]
          width = input_shape[2]
  
          position_embeddings = tf.expand_dims(
              tf.slice(
                  self._position_embeddings, [0, 0], [seq_length, width]
              ),
              axis=0,
          )
      else:
          position_embeddings = tf.expand_dims(
              self._position_embeddings, axis=0
          )
  
      return position_embeddings
  
file_path: autodist/examples/benchmark/utils/modeling/layers/position_embedding.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from utils import tf_utils
label_desc: Use image node_id 4 for calling the PositionEmbedding obj's underlying member method code with example usage: obj.call(inputs) and returns: position_embeddings