code: def to_contiguous(self: Learner, to_fp32: bool = False):
      "Set `Learner` and inputs to `contiguous_format` (default format), optionally to single precision"
      self.model.to(memory_format=torch.contiguous_format)
      if to_fp32:
          return self.remove_cbs([ChannelsLast, MixedPrecision])
      else:
          return self.remove_cb(ChannelsLast)
  
file_path: fastai/fastai/callback/channelslast.py
imports: from __future__ import annotations
  from ..basics import *
  from .fp16 import AMPMode, MixedPrecision
  from torch.cuda.amp import GradScaler
label_desc: Use image node_id 2 for calling a global function with example usage: to_contiguous(to_fp32) and returns: self, self