class_docstr: No grad context manager for Pytorch Model Inference.
  
  This context manager is used for providing no_grad context only.
class_docstr_tok: ["No","grad","context","manager","for","Pytorch","Model","Inference",".","This","context","manager","is","used","for","providing","no_grad","context","only","."]
code: def __init__(
      self, thread_num=None, accelerator=None, enable_onednn=False
  ):
      self.infer_mode_string = "inference_mode"
      self.infer_mode = torch.inference_mode(mode=True)
      self.thread_num = thread_num
      self.accelerator = accelerator
      self.enable_onednn = enable_onednn
      self.original_thread_num = torch.get_num_threads()
  
imports: import torch
  import operator
  from bigdl.nano.utils.common import compare_version
label_desc: Use image node_id 1 to create a new BaseContextManager object from inherited base classes: object with example: obj = BaseContextManager(thread_num, accelerator, enable_onednn)