r"""Return the weight matrix :math:`\mathbf{W}_e` of hyperedges of the specified hyperedge group with ``torch.Tensor`` format. Args: ``group_name`` (``str``): The name of the specified hyperedge group.
(self, group_name: str)
| 801 | return self.cache["W_e"] |
| 802 | |
| 803 | def W_e_of_group(self, group_name: str) -> torch.Tensor: |
| 804 | r"""Return the weight matrix :math:`\mathbf{W}_e` of hyperedges of the specified hyperedge group with ``torch.Tensor`` format. |
| 805 | |
| 806 | Args: |
| 807 | ``group_name`` (``str``): The name of the specified hyperedge group. |
| 808 | """ |
| 809 | assert ( |
| 810 | group_name in self.group_names |
| 811 | ), f"The specified {group_name} is not in existing hyperedge groups." |
| 812 | if self.group_cache[group_name].get("W_e") is None: |
| 813 | _tmp = self._fetch_W_of_group(group_name).view(-1) |
| 814 | _num_e = _tmp.size(0) |
| 815 | self.group_cache[group_name]["W_e"] = torch.sparse_coo_tensor( |
| 816 | torch.arange(0, _num_e).view(1, -1).repeat(2, 1), |
| 817 | _tmp, |
| 818 | torch.Size([_num_e, _num_e]), |
| 819 | device=self.device, |
| 820 | ).coalesce() |
| 821 | return self.group_cache[group_name]["W_e"] |
| 822 | |
| 823 | @property |
| 824 | def D_v(self) -> torch.Tensor: |
no test coverage detected