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 __getstate__(self):
      state = self.__dict__
      if "infer_mode" in state.keys():
          del state["infer_mode"]
      return state
  
imports: import torch
  import operator
  from bigdl.nano.utils.common import compare_version
label_desc: Use image node_id 4 for calling the BaseContextManager obj's underlying member method code with example usage: obj.__getstate__() and returns: state