class_docstr: Model of BFloat16 with auto mixed precision.
class_docstr_tok: ["Model","of","BFloat16","with","auto","mixed","precision","."]
code: def forward_step(self, *inputs):
      if self.channels_last:
          # generate channels_last_available list is possible
          # this won't affect inference latency much since it will only run 1 time
          if not self.channels_last_available:
              self.channels_last_available = (
                  generate_channels_last_available(inputs)
              )
  
          # change the data to suitable mem format
          converted_input_length = min(
              len(self.channels_last_available), len(inputs)
          )
          inputs = (
              tuple(
                  map(
                      lambda idx: apply_proper_channels_last(
                          self.channels_last_available[idx], inputs[idx]
                      ),
                      range(converted_input_length),
                  )
              )
              + inputs[converted_input_length:]
          )
  
      return self.model(*inputs)
  
imports: from logging import warning
  import torch
  import os
  from contextlib import redirect_stdout
  from bigdl.nano.utils.pytorch import generate_channels_last_available, apply_proper_channels_last
  from bigdl.nano.pytorch.model import AcceleratedLightningModule
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.utils.pytorch import TORCH_VERSION_LESS_1_10, TORCH_VERSION_LESS_1_12, transform_state_dict_to_dtype
  from bigdl.nano.utils.common import _bf16_checker
  from bigdl.nano.pytorch.context_manager import generate_context_manager
label_desc: Use image node_id 7 for calling the BF16Model obj's underlying member method code with example usage: obj.forward_step() and returns: self