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

Method to

easygraph/classes/base.py:132–148  ·  view source on GitHub ↗

r"""Move the hypergraph to the specified device. Args: ``device`` (``torch.device``): The device to store the hypergraph.

(self, device: torch.device)

Source from the content-addressed store, hash-verified

130 r"""Return a copy of this type of hypergraph."""
131
132 def to(self, device: torch.device):
133 r"""Move the hypergraph to the specified device.
134
135 Args:
136 ``device`` (``torch.device``): The device to store the hypergraph.
137 """
138 self.device = device
139 for v in self.vars_for_DL:
140 if v in self.cache and self.cache[v] is not None:
141 self.cache[v] = self.cache[v].to(device)
142 for name in self.group_names:
143 if (
144 v in self.group_cache[name]
145 and self.group_cache[name][v] is not None
146 ):
147 self.group_cache[name][v] = self.group_cache[name][v].to(device)
148 return self
149
150 # utils
151 def _hyperedge_code(self, src_v_set: List[int], dst_v_set: List[int]) -> Tuple:

Callers 2

sparse_dropoutFunction · 0.45
trainMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected