class_docstr: PureFunction class wraps methods to make it stateless and expose the pure
  function to take inputs of the original inputs (`params`) and the object's
  states (`objparams`).
  For functions, this class only acts as a thin wrapper.
  
  Restore stack stores list of (objparams, identical) everytime the objparams
  are set, it will store the old objparams and indication if the old and new
  objparams are identical.
  
  For Using this Class we first need to implement `_get_all_obj_params_init`
  and `_set_all_obj_params`.
  
  Examples
  --------
  >>> class WrapperFunction(PureFunction):
  ...     def _get_all_obj_params_init(self):
  ...         return []
  ...     def _set_all_obj_params(self, objparams):
  ...         pass
  >>> def fcn(x, y):
  ...    return x + y
  >>> pfunc = WrapperFunction(fcn)
  >>> pfunc(1, 2)
  3
class_docstr_tok: ["PureFunction","class","wraps","methods","to","make","it","stateless","and","expose","the","pure","function","to","take","inputs","of","the","original","inputs","(","`","params","`",")","and","the","object's","states","(","`","objparams","`",")",".","For","functions",",","this","class","only","acts","as","a","thin","wrapper",".","Restore","stack","stores","list","of","(","objparams",",","identical",")","everytime","the","objparams","are","set",",","it","will","store","the","old","objparams","and","indication","if","the","old","and","new","objparams","are","identical",".","For","Using","this","Class","we","first","need","to","implement","`","_get_all_obj_params_init","`","and","`","_set_all_obj_params","`",".","Examples","--","--","--","--",">",">",">","class","WrapperFunction","(","PureFunction",")",":","...","def","_get_all_obj_params_init","(","self",")",":","...","return","[","]","...","def","_set_all_obj_params","(","self",",","objparams",")",":","...","pass",">",">",">","def","fcn","(","x",",","y",")",":","...","return","x","+","y",">",">",">","pfunc","=","WrapperFunction","(","fcn",")",">",">",">","pfunc","(","1",",","2",")","3"]
docstr: Call the wrapped function with the current object parameters and
  the input parameters.
  
  Parameters
  ----------
  params: tuple
      The input parameters of the wrapped function
  
  Returns
  -------
  Any
      The output of the wrapped function
docstr_tok: ["Call","the","wrapped","function","with","the","current","object","parameters","and","the","input","parameters",".","Parameters","--","--","--","--","--","params",":","tuple","The","input","parameters","of","the","wrapped","function","Returns","--","--","--","-","Any","The","output","of","the","wrapped","function"]
code: def __call__(self, *params):
      """Call the wrapped function with the current object parameters and
      the input parameters.
  
      Parameters
      ----------
      params: tuple
          The input parameters of the wrapped function
  
      Returns
      -------
      Any
          The output of the wrapped function
  
      """
      return self._fcntocall(*params)
  
imports: import torch
  import inspect
  from typing import Callable, List, Tuple, Union
  from deepchem.utils.attribute_utils import set_attr, del_attr
  from deepchem.utils.differentiation_utils import EditableModule
  from deepchem.utils.misc_utils import Uniquifier
  from contextlib import contextmanager
  from abc import abstractmethod
label_desc: Use image node_id 2 for calling the PureFunction obj's underlying member method code with example usage: obj.__call__() and returns: self