MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / _fetch_W_of_group

Method _fetch_W_of_group

easygraph/classes/base.py:296–307  ·  view source on GitHub ↗

r"""Fetch the W matrix of the specified hyperedge group with ``torch.sparse_coo_tensor`` format. Args: ``group_name`` (``str``): The name of the group.

(self, group_name: str)

Source from the content-addressed store, hash-verified

294 return R
295
296 def _fetch_W_of_group(self, group_name: str):
297 r"""Fetch the W matrix of the specified hyperedge group with ``torch.sparse_coo_tensor`` format.
298
299 Args:
300 ``group_name`` (``str``): The name of the group.
301 """
302 assert (
303 group_name in self.group_names
304 ), f"The specified {group_name} is not in existing hyperedge groups."
305 w_list = [content["w_e"] for content in self._raw_groups[group_name].values()]
306 W = torch.tensor(w_list, device=self.device).view((-1, 1))
307 return W
308
309 # some structure modification functions
310 def add_hyperedges(

Callers 2

W_e_of_groupMethod · 0.95
W_e_of_groupMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected