code: def _create_model(
      self, train_sample: Tuple[torch.Tensor]
  ) -> torch.nn.Module:
      # samples are made of
      # (past_target, past_covariates, historic_future_covariates,
      #  future_covariates, static_covariates, future_target)
  
      raise_if(
          self.shared_weights
          and (
              train_sample[1] is not None or train_sample[2] is not None
          ),
          "Covariates have been provided, but the model has been built with shared_weights=True."
          + "Please set shared_weights=False to use covariates.",
      )
  
      input_dim = train_sample[0].shape[1] + sum(
          # add past covariates dim and historic future covariates dim, if present
          train_sample[i].shape[1] if train_sample[i] is not None else 0
          for i in (1, 2)
      )
      future_cov_dim = (
          train_sample[3].shape[1] if train_sample[3] is not None else 0
      )
  
      if train_sample[4] is None:
          static_cov_dim = 0
      else:
          # account for component-specific or shared static covariates representation
          static_cov_dim = (
              train_sample[4].shape[0] * train_sample[4].shape[1]
          )
  
      output_dim = train_sample[-1].shape[1]
  
      nr_params = (
          1
          if self.likelihood is None
          else self.likelihood.num_parameters
      )
  
      return _NLinearModule(
          input_dim=input_dim,
          output_dim=output_dim,
          future_cov_dim=future_cov_dim,
          static_cov_dim=static_cov_dim,
          nr_params=nr_params,
          shared_weights=self.shared_weights,
          const_init=self.const_init,
          normalize=self.normalize,
          **self.pl_module_params,
      )
  
file_path: darts/darts/models/forecasting/nlinear.py
imports: from typing import Optional, Tuple
  import torch
  import torch.nn
  from darts.logging import raise_if
  from darts.models.forecasting.pl_forecasting_module import PLMixedCovariatesModule, io_processor
  from darts.models.forecasting.torch_forecasting_model import MixedCovariatesTorchModel
label_desc: Use image node_id 2 for calling the NLinearModel obj's underlying member method code with example usage: obj._create_model(train_sample) and returns: _NLinearModule