class_docstr: This is the base PyTorchTrial for transformers that implements the ``__init__`` and
  ``train_batch`` methods.
  
  You can subclass ``BaseTransformerTrial`` to customize a trial for your own usage by filing in
  the expected methods for data loading and evaluation.
class_docstr_tok: ["This","is","the","base","PyTorchTrial","for","transformers","that","implements","the","``","__init__","``","and","``","train_batch","``","methods",".","You","can","subclass","``","BaseTransformerTrial","``","to","customize","a","trial","for","your","own","usage","by","filing","in","the","expected","methods","for","data","loading","and","evaluation","."]
code: def check_hparams(self) -> None:
      # We require hparams to be an AttrDict.
      if not isinstance(self.hparams, utils.AttrDict):
          self.hparams = utils.AttrDict(self.hparams)
  
      if "num_training_steps" not in self.hparams:
          # Compute the total number of training iterations used to configure the
          # learning rate scheduler.
          self.hparams.num_training_steps = (
              utils.compute_num_training_steps(
                  self.context.get_experiment_config(),
                  self.context.get_global_batch_size(),
              )
          )
      if "use_pretrained_weights" not in self.hparams:
          logging.warning(
              "We will be using pretrained weights for the model by default."
              "If you want to train the model from scratch, you can set a hyperparameter "
              "named use_pretrained_weights to false in the experiment config."
          )
          self.hparams.use_pretrained_weights = True
  
      required_hps = (
          "use_apex_amp",
          "model_mode",
          "num_training_steps",
      )
      for hp in required_hps:
          assert (
              hp in self.hparams
          ), "{} is a required hyperparameter for BaseTransformerTrial".format(
              hp
          )
  
file_path: determined/model_hub/model_hub/huggingface/_trial.py
imports: import dataclasses
  import logging
  from typing import Any, Dict, List, Optional, Tuple, Union, cast
  import datasets
  import torch
  import transformers
  import transformers.optimization
  import determined.pytorch
  from model_hub import utils
  from model_hub.huggingface import _config_parser
label_desc: Use image node_id 2 for calling the BaseTransformerTrial obj's underlying member method code with example usage: obj.check_hparams() without return types