class_docstr: Use with NonNativeMixedPrecision callback (but it needs to run at the very beginning)
class_docstr_tok: ["Use","with","NonNativeMixedPrecision","callback","(","but","it","needs","to","run","at","the","very","beginning",")"]
code: def before_fit(self):
      self.learn.model = convert_network(
          self.model, dtype=torch.float16
      )
  
imports: from __future__ import annotations
  from ..basics import *
  from .progress import *
  from torch.cuda.amp import GradScaler, autocast
  from torch.cuda.amp.grad_scaler import OptState
  from ..fp16_utils import convert_network, model_grads_to_master_grads, master_params_to_model_params
  from torch.nn.utils import parameters_to_vector
label_desc: Use image node_id 1 for calling the ModelToHalf obj's underlying member method code with example usage: obj.before_fit() without return types