class_docstr: Main TabTransformer model that inherits from AbstractModel.
  
  This model includes the full torch pipeline (TabNet) and the internal Transformer embeddings (TabTransformer).
  This file serves as the connection of all these internal models and architectures to AutoGluon.
  
  TabTransformer uses modifications to the typical Transformer architecture and the pretraining in BERT
  and applies them to the use case of tabular data. Specifically, this makes TabTransformer suitable for unsupervised
  training of Tabular data with a subsequent fine-tuning step on labeled data.
code: def _fit(
      self,
      X,
      y,
      X_val=None,
      y_val=None,
      X_unlabeled=None,
      time_limit=None,
      sample_weight=None,
      reporter=None,
      **kwargs,
  ):
      import torch
  
      self._verbosity = kwargs.get("verbosity", 2)
      num_gpus = kwargs.get("num_gpus", None)
      if num_gpus is None:
          if torch.cuda.is_available():
              self.device = torch.device("cuda")
          else:
              self.device = torch.device("cpu")
      elif num_gpus == 0:
          self.device = torch.device("cpu")
      else:
          self.device = torch.device("cuda")
  
          if num_gpus > 1:
              logger.warning(
                  "TabTransformer not yet configured to use more than 1 GPU. 'num_gpus' set to >1, but we will be using only 1 GPU."
              )
  
      if sample_weight is not None:
          logger.log(
              15,
              "sample_weight not yet supported for TabTransformerModel, this model will ignore them in training.",
          )
  
      if self.problem_type == REGRESSION:
          self.params["n_classes"] = 1
      elif self.problem_type == BINARY:
          self.params["n_classes"] = 2
      elif self.problem_type == MULTICLASS:
          self.params["n_classes"] = y.nunique()
  
      train, val, unlab = self._preprocess_train(X, X_val, X_unlabeled)
  
      num_cols = len(train.columns)
      if num_cols > self.params["max_columns"]:
          raise NotImplementedError(
              f"This dataset has {num_cols} columns and exceeds 'max_columns' == {self.params['max_columns']}.\n"
              f"Which is set by default to ensure the TabTransformer model will not run out of memory.\n"
              f"If you are confident you will have enough memory, set the 'max_columns' hyperparameter higher and try again.\n"
          )
  
      if self.problem_type == REGRESSION:
          train.targets = torch.FloatTensor(list(y))
          val.targets = torch.FloatTensor(list(y_val))
      else:
          train.targets = torch.LongTensor(list(y))
          val.targets = torch.LongTensor(list(y_val))
  
      batch_size = self.params["batch_size"]
      num_workers = self.params["num_workers"]
  
      loader_train = train.build_loader(
          batch_size, num_workers, shuffle=True
      )
      loader_val = val.build_loader(batch_size, num_workers)
      loader_unlab = (
          unlab.build_loader(batch_size, num_workers)
          if unlab is not None
          else None
      )
  
      self.cat_feat_origin_cards = loader_train.cat_feat_origin_cards
      self.params["cat_feat_origin_cards"] = self.cat_feat_origin_cards
  
      self.model = self._get_model()
  
      if X_unlabeled is not None:
          # Can't spend all the time in pretraining, have to split it up.
          pretrain_time_limit = (
              time_limit / 2 if time_limit is not None else time_limit
          )
          pretrain_before_time = time.time()
          self.tt_fit(
              loader_unlab,
              loader_val,
              y_val,
              state="pretrain",
              time_limit=pretrain_time_limit,
              reporter=reporter,
          )
          finetune_time_limit = (
              time_limit - (time.time() - pretrain_before_time)
              if time_limit is not None
              else time_limit
          )
          self.tt_fit(
              loader_train,
              loader_val,
              y_val,
              state="finetune",
              time_limit=finetune_time_limit,
              reporter=reporter,
          )
      else:
          self.tt_fit(
              loader_train,
              loader_val,
              y_val,
              time_limit=time_limit,
              reporter=reporter,
          )
  
imports: import logging
  import os
  import time
  import numpy
  import pandas
  from tqdm import tqdm
  from autogluon.common.features.types import R_OBJECT, S_TEXT_AS_CATEGORY, S_TEXT_NGRAM
  from autogluon.common.utils.try_import import try_import_torch
  from autogluon.core.constants import BINARY, MULTICLASS, REGRESSION
  from autogluon.core.models.abstract.abstract_nn_model import AbstractNeuralNetworkModel
  from autogluon.core.utils.loaders import load_pkl
  from .hyperparameters.parameters import get_default_param
  from .hyperparameters.searchspaces import get_default_searchspace
label_desc: Use image node_id 10 for calling the TabTransformerModel obj's underlying member method code with example usage: obj._fit(X, y, X_val, y_val, X_unlabeled, time_limit, sample_weight, reporter) without return types