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: Returns the list of unique parameters involved in the method
  specified by `methodname`.
  
  Parameters
  ----------
  methodname: str
      Name of the method where the returned parameters play roles.
  onlyleaves: bool
      If True, only returns leaf tensors. Otherwise, returns all tensors.
  
  Returns
  -------
  List[torch.Tensor]
      List of tensors that are involved in the specified method of the
      object.
docstr_tok: ["Returns","the","list","of","unique","parameters","involved","in","the","method","specified","by","`","methodname","`",".","Parameters","--","--","--","--","--","methodname",":","str","Name","of","the","method","where","the","returned","parameters","play","roles",".","onlyleaves",":","bool","If","True",",","only","returns","leaf","tensors",".","Otherwise",",","returns","all","tensors",".","Returns","--","--","--","-","List","[","torch.Tensor","]","List","of","tensors","that","are","involved","in","the","specified","method","of","the","object","."]
code: def getuniqueparams(
      self, methodname: str, onlyleaves: bool = False
  ) -> List[torch.Tensor]:
      """Returns the list of unique parameters involved in the method
      specified by `methodname`.
  
      Parameters
      ----------
      methodname: str
          Name of the method where the returned parameters play roles.
      onlyleaves: bool
          If True, only returns leaf tensors. Otherwise, returns all tensors.
  
      Returns
      -------
      List[torch.Tensor]
          List of tensors that are involved in the specified method of the
          object.
  
      """
      allparams = self.getparams(methodname)
      idxs = self._get_unique_params_idxs(methodname, allparams)
      if onlyleaves:
          return [allparams[i] for i in idxs if allparams[i].is_leaf]
      else:
          return [allparams[i] for i in idxs]
  
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 5 for calling the EditableModule obj's underlying member method code with example usage: obj.getuniqueparams(methodname, onlyleaves) and returns: unknown, unknown