class_docstr: The transformer encoder layer based on the "Attention is all you need" article.
  
  :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 head_count: The number of heads in self-attention layer
  :type head_count: int, default=1
  :param hidden_size: The hidden size of self-attention layer, must be a multiple of head_count
  :type hidden_size: int, default=1
  :param dropout: The rate of dropouts
  :type dropout: float, default=0.
  :param feed_forward_size: The size of the first fully-connected layer in feed-forward
  :type feed_forward_size: int, default=1
  :param activation: activation used between fully-connected layers in feed-forward
  :type activation: str, {"linear", "elu", "relu", "leaky_relu", "abs", "sigmoid", "tanh",
      "hard_tanh", "hard_sigmoid", "power", "hswish", "gelu"}, default="relu"
  :param name: The layer name.
  :type name: str, default=None
  
  .. rubric:: Layer inputs:
  
  (1) input data: the set of vector sequences, of dimensions:
  
      - **BatchLength**, **Height**, **Width** and **Depth** must be equal to 1
      - **BatchWidth** - number of sequences in batch
      - **ListSize** - length of sequences
      - **Channels** - size of the elements in sequences
  
  (2) (optional) input mask: blob containing 1.0 and 0.0 where 1.0 means IGNORED object
  
      - **Width** (seq_Q) and **Channels** (seq_V) must be equal to the ListSize of the first input
      - Other dimensions must be equal to 1
  
  .. rubric:: Layer outputs:
  
  (1) output data: float blob, of dimensions:
  
      - **BatchWidth** and **ListSize** are equal to the corresponding dims of the first input
      - **BatchLength**, **Height**, **Width** and **Depth** are equal to 1
      - **Channels** is equal to the Channels of the first input
docstr: Sets the head count of the attention.
          
docstr_tok: ["Sets","the","head","count","of","the","attention","."]
code: def head_count(self, head_count):
      """Sets the head count of the attention."""
      if head_count < 1:
          raise ValueError("The `head_count` must be > 0.")
      self._internal.set_head_count(int(head_count))
  
file_path: neoml/NeoML/Python/neoml/Dnn/Transformer.py
imports: import neoml.PythonWrapper
  from .Dnn import Layer
  from neoml.Utils import check_input_layers
  import numpy
label_desc: Use image node_id 3 for calling the TransformerEncoder obj's underlying member method code with example usage: obj.head_count(head_count) without return types