class_docstr: Pytorch version >= 1.10 and <1.12, bfloat16 precision is supported.
  But there is no optimization on bfloat16.
docstr: Debug mode. Allow run bf16 forward without bf16 instruction support.
docstr_tok: ["Debug","mode",".","Allow","run","bf16","forward","without","bf16","instruction","support","."]
code: def test_bf16_common(self):
      """
      Debug mode. Allow run bf16 forward without bf16 instruction support.
      """
      model = resnet18(num_classes=10)
  
      x = torch.rand((10, 3, 256, 256))
      y = torch.ones((10,), dtype=torch.long)
  
      bf16_model = InferenceOptimizer.quantize(model, precision="bf16")
      # Debug mode to test functionality, make sure forward is called sucessfully
      with InferenceOptimizer.get_context(bf16_model):
          y_hat = bf16_model(x)
      assert y_hat.shape == (10, 10) and y_hat.dtype == torch.bfloat16
  
imports: from unittest import TestCase
  import pytest
  import torch
  from bigdl.nano.pytorch import InferenceOptimizer
  from torchvision.models.resnet import resnet18
  from unittest.mock import MagicMock, PropertyMock, patch
  from bigdl.nano.utils.pytorch import TORCH_VERSION_LESS_1_12
  import tempfile
label_desc: Use image node_id 3 for calling the Pytorch1_12 obj's underlying member method code with example usage: obj.test_bf16_common() without return types