code: def _init_amp(model, device, optimizer=None, use_amp=None):
      model = model.to(device)
      if use_amp and optimizer:
          if AMP_AVAILABLE:
              model, optimizer = amp.initialize(
                  model, optimizer, opt_level=use_amp
              )
          else:
              logger.warning(
                  f"Can't find AMP although you specificed to use amp with level {use_amp}. Will continue without AMP ..."
              )
  
      return model, optimizer
  
file_path: FARM/farm/modeling/optimization.py
imports: from importlib import import_module
  import logging
  import sys
  import inspect
  import torch
  from torch.nn.parallel import DistributedDataParallel
  from torch.nn import DataParallel
  from transformers.optimization import AdamW
  from farm.utils import MLFlowLogger
label_desc: Use image node_id 5 for calling a global function with example usage: _init_amp(model, device, optimizer, use_amp) and returns: model,  optimizer