def get_installed_pypackages():
    return {p.project_name.lower(): p for p in pkg_resources.working_set}
def gradients(self, d_grads, g_grads):
      if self.d_grads is None:
          self.d_grads = [torch.zeros_like(_g) for _g in d_grads]
          self.g_grads = [torch.zeros_like(_g) for _g in g_grads]