code: def check_params_fp32(models):
      for model in models:
          for name, param in model.named_parameters():
              if param.is_floating_point():
                  if "Half" in param.type():
                      warn_or_err(
                          "Found param {} with type {}, expected torch.cuda.FloatTensor.\n"
                          "When using amp.initialize, you do not need to call .half() on your model\n"
                          "before passing it, no matter what optimization level you choose.".format(
                              name, param.type()
                          )
                      )
                  elif not param.is_cuda:
                      warn_or_err(
                          "Found param {} with type {}, expected torch.cuda.FloatTensor.\n"
                          "When using amp.initialize, you need to provide a model with parameters\n"
                          "located on a CUDA device before passing it no matter what optimization level\n"
                          "you chose. Use model.to('cuda') to use the default device.".format(
                              name, param.type()
                          )
                      )
  
          # Backward compatibility for PyTorch 0.4
          if hasattr(model, "named_buffers"):
              buf_iter = model.named_buffers()
          else:
              buf_iter = model._buffers
          for obj in buf_iter:
              if type(obj) == tuple:
                  name, buf = obj
              else:
                  name, buf = obj, buf_iter[obj]
              if buf.is_floating_point():
                  if "Half" in buf.type():
                      warn_or_err(
                          "Found buffer {} with type {}, expected torch.cuda.FloatTensor.\n"
                          "When using amp.initialize, you do not need to call .half() on your model\n"
                          "before passing it, no matter what optimization level you choose.".format(
                              name, buf.type()
                          )
                      )
                  elif not buf.is_cuda:
                      warn_or_err(
                          "Found buffer {} with type {}, expected torch.cuda.FloatTensor.\n"
                          "When using amp.initialize, you need to provide a model with buffers\n"
                          "located on a CUDA device before passing it no matter what optimization level\n"
                          "you chose. Use model.to('cuda') to use the default device.".format(
                              name, buf.type()
                          )
                      )
  
imports: import collections.abc
  from types import MethodType
  import functools
  import sys
  import warnings
  import numpy
  import torch
  from ._amp_state import _amp_state, warn_or_err
  from .handle import disable_casts
  from .scaler import LossScaler
  from ._process_optimizer import _process_optimizer
  from apex.fp16_utils import convert_network
  from ..fp16_utils import FP16_Optimizer
  from ..contrib.optimizers import FP16_Optimizer
label_desc: Use image node_id 4 for calling a global function with example usage: check_params_fp32(models) without return types