r"""Return the hyperedge degree matrix :math:`\mathbf{D}_e` with ``torch.sparse_coo_tensor`` format.
(self)
| 926 | |
| 927 | @property |
| 928 | def D_e(self) -> torch.Tensor: |
| 929 | r"""Return the hyperedge degree matrix :math:`\mathbf{D}_e` with ``torch.sparse_coo_tensor`` format. |
| 930 | """ |
| 931 | if self.cache.get("D_e") is None: |
| 932 | _tmp = [ |
| 933 | self.D_e_of_group(name)._values().clone() for name in self.group_names |
| 934 | ] |
| 935 | _tmp = torch.cat(_tmp, dim=0).view(-1) |
| 936 | _num_e = _tmp.size(0) |
| 937 | self.cache["D_e"] = torch.sparse_coo_tensor( |
| 938 | torch.arange(0, _num_e).view(1, -1).repeat(2, 1), |
| 939 | _tmp, |
| 940 | torch.Size([_num_e, _num_e]), |
| 941 | device=self.device, |
| 942 | ).coalesce() |
| 943 | return self.cache["D_e"] |
| 944 | |
| 945 | def D_e_of_group(self, group_name: str) -> torch.Tensor: |
| 946 | r"""Return the hyperedge degree matrix :math:`\mathbf{D}_e` of the specified hyperedge group with ``torch.sparse_coo_tensor`` format. |
nothing calls this directly
no test coverage detected