r"""Return the neighbor hyperedges of the specified vertex of the specified hyperedge group with ``torch.Tensor`` format. .. note:: The ``v_idx`` must be in the range of [0, :attr:`num_v`). Args: ``v_idx`` (``int``): The index of the vertex. ``gr
(self, v_idx: int, group_name: str)
| 1015 | return torch.cat(_tmp, dim=0) |
| 1016 | |
| 1017 | def N_e_of_group(self, v_idx: int, group_name: str) -> torch.Tensor: |
| 1018 | r"""Return the neighbor hyperedges of the specified vertex of the specified hyperedge group with ``torch.Tensor`` format. |
| 1019 | |
| 1020 | .. note:: |
| 1021 | The ``v_idx`` must be in the range of [0, :attr:`num_v`). |
| 1022 | |
| 1023 | Args: |
| 1024 | ``v_idx`` (``int``): The index of the vertex. |
| 1025 | ``group_name`` (``str``): The name of the specified hyperedge group. |
| 1026 | """ |
| 1027 | assert ( |
| 1028 | group_name in self.group_names |
| 1029 | ), f"The specified {group_name} is not in existing hyperedge groups." |
| 1030 | assert v_idx < self.num_v |
| 1031 | e_indices = self.H_of_group(group_name)[v_idx]._indices()[0] |
| 1032 | return e_indices.clone() |
| 1033 | |
| 1034 | def N_v(self, e_idx: int) -> torch.Tensor: |
| 1035 | r"""Return the neighbor vertices of the specified hyperedge with ``torch.Tensor`` format. |