class_docstr: Model of BFloat16 with auto mixed precision.
class_docstr_tok: ["Model","of","BFloat16","with","auto","mixed","precision","."]
code: def _bf16_check(self):
      if getattr(self, "_is_bf16", None) is not None:
          return self._is_bf16
  
      invalidInputError(
          not TORCH_VERSION_LESS_1_12,
          errMsg="Require torch>=1.12 to obtain bfloat16 acceleration.",
      )
  
      # ALLOW_NON_BF16_ISA indicates if we restrict bf16 instructions support to be available.
      # ALLOW_NON_BF16_ISA='1' sometimes helps debug and test cases without AVX512 or AMX
      if self._has_bf16_isa:
          self._is_bf16 = True
          # TODO: enable if torch >= 1.13,
          #  reference: https://github.com/pytorch/pytorch/commit/
          #  0e957465802204fb30e2a94cd330c16ba71955a6
          #  #diff-d730aecf3ceee9216948ee50d46f015c327d65b9f0c4981ef7adfa44dddc2673
          # max_bf16_isa = self._max_bf16_isa(*args, **kwargs)
          # if max_bf16_isa:
          #     info("{} BF16 support is enabled in this model.".format(max_bf16_isa))
          #     self._is_bf16 = True
          # else:
          #     if self._allow_non_bf16:
          #         self._is_bf16 = False
          #     else:
          #         invalidOperationError(
          #             False,
          #             errMsg="BF16 ISA support is not enabled under current context.",
          #             fixMsg="Please try to upgrade your pytorch version to obtain"
          #                    " BF16 acceleration."
          #         )
      else:
          # close error for no BF16 instructions, just warning.
          self._is_bf16 = False
          # if self._allow_non_bf16:
          #     self._is_bf16 = False
  
          # else:
          #     invalidOperationError(
          #         False,
          #         errMsg="Your machine or OS doesn't support BF16 instructions.",
          #         fixMsg="Please check your machine and OS to make sure"
          #                " BF16 support is available."
          #     )
  
      if not self._is_bf16:
          warning(
              "Your machine or OS doesn't support BF16 instructions. "
              "You are running BF16 model without ISA support, and the "
              "performance might be quite low."
          )
  
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 9 for calling the BF16Model obj's underlying member method code with example usage: obj._bf16_check() and returns: self