class_docstr: Non-recurrent encoder based on the transformer architecture in:
  
  Attention Is All You Need, Figure 1 (left)
  Vaswani et al. (https://arxiv.org/pdf/1706.03762.pdf).
  
  :param config: Configuration for transformer encoder.
docstr: Return the representation size of this encoder.
docstr_tok: ["Return","the","representation","size","of","this","encoder","."]
code: def get_num_hidden(self) -> int:
      """
      Return the representation size of this encoder.
      """
      return self.config.model_size
  
imports: from abc import abstractmethod
  from dataclasses import dataclass, field
  from typing import List, Tuple, Optional, Union
  import torch
  import sockeye.constants
  from .None import config
  from .None import layers
  from .None import transformer
label_desc: Use image node_id 3 for calling the TransformerEncoder obj's underlying member method code with example usage: obj.get_num_hidden() and returns: self