class_docstr: EditableModule is a base class to enable classes that it inherits be
  converted to pure functions for higher order derivatives purpose.
  
  Usage
  -----
  To use this class, the user must implement the ``getparamnames`` method
  which returns a list of tensor names that affect the output of the method
  with name indicated in ``methodname``.
  
  Used in:
  
  - Classes of Density Functional Theory (DFT).
  
  - It can also be used in other classes that need to be converted to pure
    functions for higher order derivatives purpose.
  
  Examples
  --------
  >>> import torch
  >>> from deepchem.utils.differentiation_utils import EditableModule
  >>> class A(EditableModule):
  ...     def __init__(self, a):
  ...         self.b = a*a
  ...
  ...     def mult(self, x):
  ...         return self.b * x
  ...
  ...     def getparamnames(self, methodname, prefix=""):
  ...         if methodname == "mult":
  ...             return [prefix+"b"]
  ...         else:
  ...             raise KeyError()
  >>> a = torch.tensor(2.0).requires_grad_()
  >>> x = torch.tensor(0.4).requires_grad_()
  >>> alpha = A(a)
  >>> alpha.mult(x)
  tensor(1.6000, grad_fn=<MulBackward0>)
  >>> alpha.getparamnames("mult")
  ['b']
  >>> alpha.assertparams(alpha.mult, x)
  "mult" method check done
docstr: Set the input parameters to the object's parameters to make a copy of
  the operations.
  
  Parameters
  ----------
  methodname: str
      The name of the method of the class.
  *params:
      The parameters to be set to the object's parameters.
  
  Returns
  -------
  int
      The number of parameters that are set to the object's parameters.
docstr_tok: ["Set","the","input","parameters","to","the","object","'s","parameters","to","make","a","copy","of","the","operations",".","Parameters","--","--","--","--","--","methodname",":","str","The","name","of","the","method","of","the","class",".","*","params",":","The","parameters","to","be","set","to","the","object","'s","parameters",".","Returns","--","--","--","-","int","The","number","of","parameters","that","are","set","to","the","object","'s","parameters","."]
code: def setparams(self, methodname: str, *params) -> int:
      """Set the input parameters to the object's parameters to make a copy of
      the operations.
  
      Parameters
      ----------
      methodname: str
          The name of the method of the class.
      *params:
          The parameters to be set to the object's parameters.
  
      Returns
      -------
      int
          The number of parameters that are set to the object's parameters.
  
      """
      paramnames = self.cached_getparamnames(methodname)
      for name, val in zip(paramnames, params):
          try:
              set_attr(self, name, val)
          except TypeError:  # failed because val should be param
              del_attr(self, name)
              set_attr(self, name, val)
  
      return len(params)
  
imports: import inspect
  import warnings
  from abc import abstractmethod
  import copy
  import torch
  from typing import Sequence, Union, Dict, List, Callable, Any
  from deepchem.utils.attribute_utils import get_attr, set_attr, del_attr
label_desc: Use image node_id 2 for calling the EditableModule obj's underlying member method code with example usage: obj.setparams(methodname) and returns: len