class_docstr: The layer that maps positions in sequence into vectors, 
  optionally trainable. The exact formula depends on the type_name parameter.
  
  The formula for "transformers":
  result[i][j][k] = input[i][j][k] + sin(j / pow(10000, (k / vectorLength))),
  where:
  
      - i is the index of sequence in batch (from 0 to BatchWidth - 1)
      - j is the position of vector in sequence (from 0 to ListSize - 1)
      - k is the index of the element in the vector (from 0 to vectorLength - 1)
  
  The formula for "learnable_addition":
  result[i][j] = input[i][j] + addends[j],
  where:
  
      - i is the index of sequence in batch (from 0 to BatchWidth - 1)
      - j is the position of vector in sequence (from 0 to ListSize - 1)
      - addends is the trainable vector to be added
  
  :param input_layer: The input layer and the number of its output. If no number
      is specified, the first output will be connected.
  :type input_layer: object, tuple(object, int)
  :param type_name: The operation type.    
  :type type_name: str, {"learnable_addition", "transformers"}
  :param name: The layer name.
  :type name: str, default=None
  
  .. rubric:: Layer inputs:
  
  (1) a blob with vector sequences.
      The dimensions:
  
      - **BatchLength** is 1
      - **BatchWidth** is the number of sequences in the set
      - **ListSize** is the sequence length
      - **Height** * **Width** * **Depth** * **Channels** is the vector length;
        for "transformers", **Height**, **Width**, and **Depth** should be 1,
        vector length is equal to **Channels**
  
  .. rubric:: Layer outputs:
  
  (1) the transformation result, of the same dimensions as the input.
docstr: Sets the type of operation the layer performs.
          
docstr_tok: ["Sets","the","type","of","operation","the","layer","performs","."]
code: def type(self, type):
      """Sets the type of operation the layer performs."""
      type_index = self.types.index(type)
  
      self._internal.set_type(type_index)
  
file_path: neoml/NeoML/Python/neoml/Dnn/PositionalEmbedding.py
imports: import neoml.PythonWrapper
  from .Dnn import Layer
  from neoml.Utils import check_input_layers
  import neoml.Blob
label_desc: Use image node_id 3 for calling the PositionalEmbedding obj's underlying member method code with example usage: obj.type(type) without return types