pyg-nightly 2.7.0.dev20241211__py3-none-any.whl → 2.7.0.dev20241212__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyg-nightly
3
- Version: 2.7.0.dev20241211
3
+ Version: 2.7.0.dev20241212
4
4
  Summary: Graph Neural Network Library for PyTorch
5
5
  Keywords: deep-learning,pytorch,geometric-deep-learning,graph-neural-networks,graph-convolutional-networks
6
6
  Author-email: Matthias Fey <matthias@pyg.org>
@@ -1,4 +1,4 @@
1
- torch_geometric/__init__.py,sha256=1TfT5cqJlgoPBQaQF262nRy1nM-KWSSrylkDwcVvoWU,1904
1
+ torch_geometric/__init__.py,sha256=rM2co1RdbpOI7hq4w_6b4AmFYqhWfKQFujUwtX-vY2I,1904
2
2
  torch_geometric/_compile.py,sha256=f-WQeH4VLi5Hn9lrgztFUCSrN_FImjhQa6BxFzcYC38,1338
3
3
  torch_geometric/_onnx.py,sha256=V9ffrIKSqhDw6xUZ12lkuSfNs48cQp2EeJ6Z19GfnVw,349
4
4
  torch_geometric/backend.py,sha256=lVaf7aLoVaB3M-UcByUJ1G4T4FOK6LXAg0CF4W3E8jo,1575
@@ -18,7 +18,7 @@ torch_geometric/logging.py,sha256=HmHHLiCcM64k-6UYNOSfXPIeSGNAyiGGcn8cD8tlyuQ,85
18
18
  torch_geometric/resolver.py,sha256=fn-_6mCpI2xv7eDZnIFcYrHOn0IrwbkWFLDb9laQrWI,1270
19
19
  torch_geometric/seed.py,sha256=MJLbVwpb9i8mK3oi32sS__Cq-dRq_afTeoOL_HoA9ko,372
20
20
  torch_geometric/template.py,sha256=rqjDWgcSAgTCiV4bkOjWRPaO4PpUdC_RXigzxxBqAu8,1060
21
- torch_geometric/typing.py,sha256=0pxCLue4iqqFC-k5ByqAeyg2mogtWXqgtod3ZOEMq1A,13933
21
+ torch_geometric/typing.py,sha256=PO6jvRjcGkZoMPBEo9GANZN5gUqHV1YEbUBbbdaX1oE,14331
22
22
  torch_geometric/warnings.py,sha256=t114CbkrmiqkXaavx5g7OO52dLdktf-U__B5QqYIQvI,413
23
23
  torch_geometric/contrib/__init__.py,sha256=0pWkmXfZtbdr-AKwlii5LTFggTEH-MCrSKpZxrtPlVs,352
24
24
  torch_geometric/contrib/datasets/__init__.py,sha256=lrGnWsEiJf5zsBRmshGZZFN_uYR2ezDjbj9n9nCpvtk,23
@@ -629,6 +629,6 @@ torch_geometric/utils/undirected.py,sha256=H_nfpI0_WluOG6VfjPyldvcjL4w5USAKWu2x5
629
629
  torch_geometric/visualization/__init__.py,sha256=PyR_4K5SafsJrBr6qWrkjKr6GBL1b7FtZybyXCDEVwY,154
630
630
  torch_geometric/visualization/graph.py,sha256=ZuLPL92yGRi7lxlqsUPwL_EVVXF7P2kMcveTtW79vpA,4784
631
631
  torch_geometric/visualization/influence.py,sha256=CWMvuNA_Nf1sfbJmQgn58yS4OFpeKXeZPe7kEuvkUBw,477
632
- pyg_nightly-2.7.0.dev20241211.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
633
- pyg_nightly-2.7.0.dev20241211.dist-info/METADATA,sha256=tE3LwsTMPbErhuYwqAYvxLnudXiWvqK4LdWXoNi2lHY,62979
634
- pyg_nightly-2.7.0.dev20241211.dist-info/RECORD,,
632
+ pyg_nightly-2.7.0.dev20241212.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
633
+ pyg_nightly-2.7.0.dev20241212.dist-info/METADATA,sha256=SgH5YIFmqInilgeBdaYxaHN1mejOmP0RzY6Pfu90xF8,62979
634
+ pyg_nightly-2.7.0.dev20241212.dist-info/RECORD,,
@@ -30,7 +30,7 @@ from .lazy_loader import LazyLoader
30
30
  contrib = LazyLoader('contrib', globals(), 'torch_geometric.contrib')
31
31
  graphgym = LazyLoader('graphgym', globals(), 'torch_geometric.graphgym')
32
32
 
33
- __version__ = '2.7.0.dev20241211'
33
+ __version__ = '2.7.0.dev20241212'
34
34
 
35
35
  __all__ = [
36
36
  'Index',
torch_geometric/typing.py CHANGED
@@ -307,6 +307,8 @@ class EdgeTypeStr(str):
307
307
  r"""A helper class to construct serializable edge types by merging an edge
308
308
  type tuple into a single string.
309
309
  """
310
+ edge_type: tuple[str, str, str]
311
+
310
312
  def __new__(cls, *args: Any) -> 'EdgeTypeStr':
311
313
  if isinstance(args[0], (list, tuple)):
312
314
  # Unwrap `EdgeType((src, rel, dst))` and `EdgeTypeStr((src, dst))`:
@@ -314,27 +316,34 @@ class EdgeTypeStr(str):
314
316
 
315
317
  if len(args) == 1 and isinstance(args[0], str):
316
318
  arg = args[0] # An edge type string was passed.
319
+ edge_type = tuple(arg.split(EDGE_TYPE_STR_SPLIT))
320
+ if len(edge_type) != 3:
321
+ raise ValueError(f"Cannot convert the edge type '{arg}' to a "
322
+ f"tuple since it holds invalid characters")
317
323
 
318
324
  elif len(args) == 2 and all(isinstance(arg, str) for arg in args):
319
325
  # A `(src, dst)` edge type was passed - add `DEFAULT_REL`:
320
- arg = EDGE_TYPE_STR_SPLIT.join((args[0], DEFAULT_REL, args[1]))
326
+ edge_type = (args[0], DEFAULT_REL, args[1])
327
+ arg = EDGE_TYPE_STR_SPLIT.join(edge_type)
321
328
 
322
329
  elif len(args) == 3 and all(isinstance(arg, str) for arg in args):
323
330
  # A `(src, rel, dst)` edge type was passed:
331
+ edge_type = tuple(args)
324
332
  arg = EDGE_TYPE_STR_SPLIT.join(args)
325
333
 
326
334
  else:
327
335
  raise ValueError(f"Encountered invalid edge type '{args}'")
328
336
 
329
- return str.__new__(cls, arg)
337
+ out = str.__new__(cls, arg)
338
+ out.edge_type = edge_type # type: ignore
339
+ return out
330
340
 
331
341
  def to_tuple(self) -> EdgeType:
332
342
  r"""Returns the original edge type."""
333
- out = tuple(self.split(EDGE_TYPE_STR_SPLIT))
334
- if len(out) != 3:
343
+ if len(self.edge_type) != 3:
335
344
  raise ValueError(f"Cannot convert the edge type '{self}' to a "
336
345
  f"tuple since it holds invalid characters")
337
- return out
346
+ return self.edge_type
338
347
 
339
348
 
340
349
  # There exist some short-cuts to query edge-types (given that the full triplet