code: def _create_model(
      self, train_sample: Tuple[torch.Tensor]
  ) -> torch.nn.Module:
      # samples are made of (past_target, past_covariates, future_target)
      input_dim = train_sample[0].shape[1] + (
          train_sample[1].shape[1] if train_sample[1] is not None else 0
      )
      output_dim = train_sample[-1].shape[1]
      nr_params = (
          1
          if self.likelihood is None
          else self.likelihood.num_parameters
      )
  
      return _TransformerModule(
          input_size=input_dim,
          output_size=output_dim,
          nr_params=nr_params,
          d_model=self.d_model,
          nhead=self.nhead,
          num_encoder_layers=self.num_encoder_layers,
          num_decoder_layers=self.num_decoder_layers,
          dim_feedforward=self.dim_feedforward,
          dropout=self.dropout,
          activation=self.activation,
          norm_type=self.norm_type,
          custom_encoder=self.custom_encoder,
          custom_decoder=self.custom_decoder,
          **self.pl_module_params,
      )
  
imports: import math
  from typing import Optional, Tuple, Union
  import torch
  import torch.nn
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from darts.models.components import glu_variants, layer_norm_variants
  from darts.models.components.glu_variants import GLU_FFN
  from darts.models.components.transformer import CustomFeedForwardDecoderLayer, CustomFeedForwardEncoderLayer
  from darts.models.forecasting.pl_forecasting_module import PLPastCovariatesModule, io_processor
  from darts.models.forecasting.torch_forecasting_model import PastCovariatesTorchModel
label_desc: Use image node_id 3 for calling the TransformerModel obj's underlying member method code with example usage: obj._create_model(train_sample) and returns: _TransformerModule