r"""Return the vertex degree matrix :math:`\mathbf{D}_v^{-1}` of the specified hyperedge group with ``torch.sparse_coo_tensor`` format. Args: ``group_name`` (``str``): The name of the specified hyperedge group.
(self, group_name: str)
| 876 | return self.cache["D_v_neg_1"] |
| 877 | |
| 878 | def D_v_neg_1_of_group(self, group_name: str) -> torch.Tensor: |
| 879 | r"""Return the vertex degree matrix :math:`\mathbf{D}_v^{-1}` of the specified hyperedge group with ``torch.sparse_coo_tensor`` format. |
| 880 | |
| 881 | Args: |
| 882 | ``group_name`` (``str``): The name of the specified hyperedge group. |
| 883 | """ |
| 884 | assert ( |
| 885 | group_name in self.group_names |
| 886 | ), f"The specified {group_name} is not in existing hyperedge groups." |
| 887 | if self.group_cache[group_name].get("D_v_neg_1") is None: |
| 888 | _mat = self.D_v_of_group(group_name).clone() |
| 889 | _val = _mat._values() ** -1 |
| 890 | _val[torch.isinf(_val)] = 0 |
| 891 | self.group_cache[group_name]["D_v_neg_1"] = torch.sparse_coo_tensor( |
| 892 | _mat._indices(), _val, _mat.size(), device=self.device |
| 893 | ).coalesce() |
| 894 | return self.group_cache[group_name]["D_v_neg_1"] |
| 895 | |
| 896 | @property |
| 897 | def D_v_neg_1_2(self) -> torch.Tensor: |