class_docstr: Builder for BERT model Trainer with overrides.
code: def _grad_scaler(self) -> GradScaler:
      return GradScaler(
          init_scale=self.cfg.model.get(
              "native_amp_init_scale", 2**32
          ),
          growth_interval=self.cfg.model.get(
              "native_amp_growth_interval", 1000
          ),
      )
  
imports: import sys
  from typing import Union
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from pytorch_lightning.callbacks import ModelSummary
  from pytorch_lightning.plugins.environments import TorchElasticEnvironment
  from nemo.collections.nlp.parts.nlp_overrides import CustomProgressBar, GradScaler, MegatronHalfPrecisionPlugin, NLPDDPStrategy, NLPDDPStrategyNotebook, NLPFSDPStrategy, PipelineMixedPrecisionPlugin
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling the MegatronBertTrainerBuilder obj's underlying member method code with example usage: obj._grad_scaler() and returns: GradScaler