r"""Return the weight matrix :math:`\mathbf{W}_e` of hyperedges with ``torch.Tensor`` format.
(self)
| 784 | |
| 785 | @property |
| 786 | def W_e(self) -> torch.Tensor: |
| 787 | r"""Return the weight matrix :math:`\mathbf{W}_e` of hyperedges with ``torch.Tensor`` format. |
| 788 | """ |
| 789 | if self.cache.get("W_e") is None: |
| 790 | _tmp = [ |
| 791 | self.W_e_of_group(name)._values().clone() for name in self.group_names |
| 792 | ] |
| 793 | _tmp = torch.cat(_tmp, dim=0).view(-1) |
| 794 | _num_e = _tmp.size(0) |
| 795 | self.cache["W_e"] = torch.sparse_coo_tensor( |
| 796 | torch.arange(0, _num_e).view(1, -1).repeat(2, 1), |
| 797 | _tmp, |
| 798 | torch.Size([_num_e, _num_e]), |
| 799 | device=self.device, |
| 800 | ).coalesce() |
| 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. |
nothing calls this directly
no test coverage detected