code: def test_sharded_grad_scaler_found_inf(self):
      self.run_subtests(
          {
              "use_orig_params": [False, True],
              "cpu_offload": [
                  CPUOffload(offload_params=True),
                  CPUOffload(offload_params=False),
              ],
          },
          self._test_sharded_grad_scaler_found_inf,
      )
  
imports: import copy
  import functools
  import itertools
  import sys
  import unittest
  from typing import List, Optional
  import torch
  from torch import distributed
  from torch.cuda.amp.common import amp_definitely_not_available
  from torch.distributed.fsdp import CPUOffload, MixedPrecision
  from torch.distributed.fsdp.fully_sharded_data_parallel import FullyShardedDataParallel, ShardingStrategy
  from torch.distributed.fsdp.sharded_grad_scaler import ShardedGradScaler
  from torch.distributed.fsdp.wrap import ModuleWrapPolicy
  from torch.nn import TransformerDecoderLayer, TransformerEncoderLayer
  from torch.nn.parallel.distributed import DistributedDataParallel
  from torch.testing._internal.common_distributed import skip_if_lt_x_gpu
  from torch.testing._internal.common_fsdp import CUDAInitMode, DummyProcessGroup, FSDPInitMode, FSDPTest, NestedWrappedModule, NonUniformReqGradNWM, subtest_name, TransformerWithSharedParams
  from torch.testing._internal.common_utils import instantiate_parametrized_tests, parametrize, run_tests, TEST_WITH_DEV_DBG_ASAN, TestCase
label_desc: Use image node_id 4 for calling the TestShardedGradScalerParityWithDDP obj's underlying member method code with example usage: obj.test_sharded_grad_scaler_found_inf() without return types