pyg-nightly 2.7.0.dev20250414__py3-none-any.whl → 2.7.0.dev20250416__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.4
2
2
  Name: pyg-nightly
3
- Version: 2.7.0.dev20250414
3
+ Version: 2.7.0.dev20250416
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>
@@ -61,6 +61,12 @@ Requires-Dist: protobuf<4.21 ; extra == "graphgym"
61
61
  Requires-Dist: pytorch-lightning<2.3.0 ; extra == "graphgym"
62
62
  Requires-Dist: yacs ; extra == "graphgym"
63
63
  Requires-Dist: huggingface_hub ; extra == "modelhub"
64
+ Requires-Dist: pcst_fast ; extra == "rag"
65
+ Requires-Dist: datasets ; extra == "rag"
66
+ Requires-Dist: transformers ; extra == "rag"
67
+ Requires-Dist: pandas ; extra == "rag"
68
+ Requires-Dist: sentencepiece ; extra == "rag"
69
+ Requires-Dist: accelerate ; extra == "rag"
64
70
  Requires-Dist: onnx ; extra == "test"
65
71
  Requires-Dist: onnxruntime ; extra == "test"
66
72
  Requires-Dist: pytest ; extra == "test"
@@ -74,6 +80,7 @@ Provides-Extra: dev
74
80
  Provides-Extra: full
75
81
  Provides-Extra: graphgym
76
82
  Provides-Extra: modelhub
83
+ Provides-Extra: rag
77
84
  Provides-Extra: test
78
85
 
79
86
  <p align="center">
@@ -1,4 +1,4 @@
1
- torch_geometric/__init__.py,sha256=gL3VBzLbnTDZMx7XwpSf7shcnqbMg36uT_MEgesPhSY,1978
1
+ torch_geometric/__init__.py,sha256=en3YAn8JWtZUWaMs1gx9X-Z0xZM9IfGB3fvTW53cJno,1978
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
@@ -44,7 +44,7 @@ torch_geometric/data/graph_store.py,sha256=EtIgsyY7RdBHRTCn34VypEBOG8cg8WzsNT_kT
44
44
  torch_geometric/data/hetero_data.py,sha256=q0L3bENyEvo_BGLPwZPVzh730Aak6sQ7yXoawPgM72E,47982
45
45
  torch_geometric/data/hypergraph_data.py,sha256=33hsXW25Yz4Ju8mKajYinZOrkqrUi1SqThG7MlOOYNM,8294
46
46
  torch_geometric/data/in_memory_dataset.py,sha256=F35hU9Dw3qiJUL5E1CCAfq-1xrlUMstXBmQVEQdtJ1I,13403
47
- torch_geometric/data/large_graph_indexer.py,sha256=eor7F98kPDlrs1v0qypinVbhQr8wnw8mAfsLNiNmEwY,25390
47
+ torch_geometric/data/large_graph_indexer.py,sha256=3mF2c7BLbnAg8h5mBaG95_lyQMiXJ_uhEe5bXbX7e1M,25430
48
48
  torch_geometric/data/makedirs.py,sha256=6uOv4y34i947cm4rv7Aj2_YZBq-EOsyPKnlGA188YSw,463
49
49
  torch_geometric/data/on_disk_dataset.py,sha256=77om-e6kzcpBb77kf7um1xY8-yHmQaao_6R7I-3NwHk,6629
50
50
  torch_geometric/data/remote_backend_utils.py,sha256=Rzpq1PczXuHhUscrFtIAL6dua6pMehSJlXG7yEsrrrg,4503
@@ -441,7 +441,7 @@ torch_geometric/nn/models/g_retriever.py,sha256=CdSOasnPiMvq5AjduNTpz-LIZiNp3X0x
441
441
  torch_geometric/nn/models/git_mol.py,sha256=Wc6Hx6RDDR7sDWRWHfA5eK9e9gFsrTZ9OLmpMfoj3pE,12676
442
442
  torch_geometric/nn/models/glem.py,sha256=sT0XM4klVlci9wduvUoXupATUw9p25uXtaJBrmv3yvs,16431
443
443
  torch_geometric/nn/models/gnnff.py,sha256=15dkiLgy0LmH1hnUrpeoHioIp4BPTfjpVATpnGRt9E0,7860
444
- torch_geometric/nn/models/gpse.py,sha256=Fwldw9N3axV--BcSnI4im1sy1r87a5mAXZAXHu_6k2Y,41932
444
+ torch_geometric/nn/models/gpse.py,sha256=NSN7yL98a9KzPjhwEpqOyx4RVtEfOPhFc0opejpTGVk,41981
445
445
  torch_geometric/nn/models/graph_mixer.py,sha256=mthMeCOikR8gseEsu4oJ3Cd9C35zHSv1p32ROwnG-6s,9246
446
446
  torch_geometric/nn/models/graph_unet.py,sha256=N8TSmJo8AlbZjjcame0xW_jZvMOirL5ahw6qv5Yjpbs,5586
447
447
  torch_geometric/nn/models/jumping_knowledge.py,sha256=9JR2EoViXKjcDSLb8tjJm-UHfv1mQCJvZAAEsYa0Ocw,5496
@@ -515,15 +515,15 @@ torch_geometric/sampler/base.py,sha256=kT6hYM6losYta3pqLQlqiqboJiujLy6RlH8qM--U_
515
515
  torch_geometric/sampler/hgt_sampler.py,sha256=UAm8_wwzEcziKDJ8-TnfZh1705dXRsy_I5PKhZSDTK8,2721
516
516
  torch_geometric/sampler/neighbor_sampler.py,sha256=MAVphWqNf0-cwlHRvdiU8de86dBxwjm3Miam_6s1ep4,33971
517
517
  torch_geometric/sampler/utils.py,sha256=RJtasO6Q7Pp3oYEOWrbf2DEYuSfuKZOsF2I7-eJDnoA,5485
518
- torch_geometric/testing/__init__.py,sha256=0mAGVWRrTBNsGV2YUkCu_FkyQ8JIcrYVw2LsdKgY9ak,1291
518
+ torch_geometric/testing/__init__.py,sha256=m3yp_5UnCAxVgzTFofpiVt0vdbl5GwVAve8WTrAaNxo,1319
519
519
  torch_geometric/testing/asserts.py,sha256=DLC9HnBgFWuTIiQs2OalsQcXGhOVG-e6R99IWhkO32c,4606
520
520
  torch_geometric/testing/data.py,sha256=O1qo8FyNxt6RGf63Ys3eXBfa5RvYydeZLk74szrez3c,2604
521
- torch_geometric/testing/decorators.py,sha256=BaaQRGgU1r1_p3OTpSLzgUaROq6EB2vojq4VKSzXE6w,8657
521
+ torch_geometric/testing/decorators.py,sha256=k7QtPWz-8Ft89cvKmZt8y1h00j2BB1yhEHwmGzTcol0,9075
522
522
  torch_geometric/testing/distributed.py,sha256=ZZCCXqiQC4-m1ExSjDZhS_a1qPXnHEwhJGTmACxNnVI,2227
523
523
  torch_geometric/testing/feature_store.py,sha256=J6JBIt2XK-t8yG8B4JzXp-aJcVl5jaCS1m2H7d6OUxs,2158
524
524
  torch_geometric/testing/graph_store.py,sha256=00B7QToCIspYmgN7svQKp1iU-qAzEtrt3VQRFxkHfuk,1044
525
525
  torch_geometric/transforms/__init__.py,sha256=P0R2CFg9pXxjTX4NnYfNPrifRPAw5lVXEOxO80q-1Ek,4296
526
- torch_geometric/transforms/add_gpse.py,sha256=4o0UrSmTu3CKsL3UAREiul8O4lC02PUx_ajxP4sPsxU,1570
526
+ torch_geometric/transforms/add_gpse.py,sha256=ex7cSLmcSIn-dC5gbic-CLwKegV5Is7Y8mUn-mSOWXg,1555
527
527
  torch_geometric/transforms/add_metapaths.py,sha256=GabaPRvUnpFrZJsxLMUBY2Egzx94GTgsMxegL_qTtbk,14239
528
528
  torch_geometric/transforms/add_positional_encoding.py,sha256=tuilyubAn3yeyz8mvFc5zxXTlNzh8okKzG9AE2lPG1Q,6049
529
529
  torch_geometric/transforms/add_remaining_self_loops.py,sha256=ItU5FAcE-mkbp_wqTLkRhv0RShR5JVr8vr9d5xv3_Ak,2085
@@ -636,7 +636,7 @@ torch_geometric/utils/undirected.py,sha256=H_nfpI0_WluOG6VfjPyldvcjL4w5USAKWu2x5
636
636
  torch_geometric/visualization/__init__.py,sha256=PyR_4K5SafsJrBr6qWrkjKr6GBL1b7FtZybyXCDEVwY,154
637
637
  torch_geometric/visualization/graph.py,sha256=ZuLPL92yGRi7lxlqsUPwL_EVVXF7P2kMcveTtW79vpA,4784
638
638
  torch_geometric/visualization/influence.py,sha256=CWMvuNA_Nf1sfbJmQgn58yS4OFpeKXeZPe7kEuvkUBw,477
639
- pyg_nightly-2.7.0.dev20250414.dist-info/licenses/LICENSE,sha256=ic-27cMJc1kWoMEYncz3Ya3Ur2Bi3bNLWib2DT763-o,1067
640
- pyg_nightly-2.7.0.dev20250414.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
641
- pyg_nightly-2.7.0.dev20250414.dist-info/METADATA,sha256=1EHha-manNSei-aDwCeZuM7b0CJ05SQ4PN3dMRTPWtY,62703
642
- pyg_nightly-2.7.0.dev20250414.dist-info/RECORD,,
639
+ pyg_nightly-2.7.0.dev20250416.dist-info/licenses/LICENSE,sha256=ic-27cMJc1kWoMEYncz3Ya3Ur2Bi3bNLWib2DT763-o,1067
640
+ pyg_nightly-2.7.0.dev20250416.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
641
+ pyg_nightly-2.7.0.dev20250416.dist-info/METADATA,sha256=yDodf56EgttruZas0nqEgbfnFaNHm03BHQsFi-IkPf0,62979
642
+ pyg_nightly-2.7.0.dev20250416.dist-info/RECORD,,
@@ -31,7 +31,7 @@ from .lazy_loader import LazyLoader
31
31
  contrib = LazyLoader('contrib', globals(), 'torch_geometric.contrib')
32
32
  graphgym = LazyLoader('graphgym', globals(), 'torch_geometric.graphgym')
33
33
 
34
- __version__ = '2.7.0.dev20250414'
34
+ __version__ = '2.7.0.dev20250416'
35
35
 
36
36
  __all__ = [
37
37
  'Index',
@@ -22,6 +22,7 @@ from torch import Tensor
22
22
  from tqdm import tqdm
23
23
 
24
24
  from torch_geometric.data import Data
25
+ from torch_geometric.io import fs
25
26
  from torch_geometric.typing import WITH_PT24
26
27
 
27
28
  # Could be any hashable type
@@ -505,13 +506,13 @@ class LargeGraphIndexer:
505
506
  for fname in os.listdir(node_attr_path):
506
507
  full_fname = f"{node_attr_path}/{fname}"
507
508
  key = fname.split(".")[0]
508
- indexer.node_attr[key] = torch.load(full_fname)
509
+ indexer.node_attr[key] = fs.torch_load(full_fname)
509
510
 
510
511
  edge_attr_path = path + "/edge_attr"
511
512
  for fname in os.listdir(edge_attr_path):
512
513
  full_fname = f"{edge_attr_path}/{fname}"
513
514
  key = fname.split(".")[0]
514
- indexer.edge_attr[key] = torch.load(full_fname)
515
+ indexer.edge_attr[key] = fs.torch_load(full_fname)
515
516
 
516
517
  return indexer
517
518
 
@@ -9,6 +9,7 @@ import numpy as np
9
9
  import torch
10
10
  import torch.nn as nn
11
11
  import torch.nn.functional as F
12
+ from torch.nn import Module
12
13
  from tqdm import trange
13
14
 
14
15
  import torch_geometric.transforms as T
@@ -715,8 +716,9 @@ class GPSENodeEncoder(torch.nn.Module):
715
716
 
716
717
 
717
718
  @torch.no_grad()
718
- def gpse_process(model: GPSE, data: Data, rand_type: str, use_vn: bool = True,
719
- bernoulli_thresh: float = 0.5, neighbor_loader: bool = False,
719
+ def gpse_process(model: Module, data: Data, rand_type: str,
720
+ use_vn: bool = True, bernoulli_thresh: float = 0.5,
721
+ neighbor_loader: bool = False,
720
722
  num_neighbors: List[int] = [30, 20, 10], fillval: int = 5,
721
723
  layers_mp: int = None, **kwargs) -> torch.Tensor:
722
724
  r"""Processes the data using the :class:`GPSE` model to generate and append
@@ -731,7 +733,7 @@ def gpse_process(model: GPSE, data: Data, rand_type: str, use_vn: bool = True,
731
733
  :obj:`precompute_GPSE` on your whole dataset is advised instead.
732
734
 
733
735
  Args:
734
- model (GPSE): The :class:`GPSE` model.
736
+ model (Module): The :class:`GPSE` model.
735
737
  data (torch_geometric.data.Data): A :class:`~torch_geometric.data.Data`
736
738
  object.
737
739
  rand_type (str, optional): Type of random features to use. Options are
@@ -17,6 +17,7 @@ from .decorators import (
17
17
  onlyOnline,
18
18
  onlyGraphviz,
19
19
  onlyNeighborSampler,
20
+ onlyRAG,
20
21
  has_package,
21
22
  withPackage,
22
23
  withDevice,
@@ -49,6 +50,7 @@ __all__ = [
49
50
  'onlyOnline',
50
51
  'onlyGraphviz',
51
52
  'onlyNeighborSampler',
53
+ 'onlyRAG',
52
54
  'has_package',
53
55
  'withPackage',
54
56
  'withDevice',
@@ -15,6 +15,11 @@ from torch_geometric.typing import WITH_METIS, WITH_PYG_LIB, WITH_TORCH_SPARSE
15
15
  from torch_geometric.visualization.graph import has_graphviz
16
16
 
17
17
 
18
+ def is_rag_test() -> bool:
19
+ r"""Whether to run the RAG test suite."""
20
+ return os.getenv('RAG_TEST', '0') == '1'
21
+
22
+
18
23
  def is_full_test() -> bool:
19
24
  r"""Whether to run the full but time-consuming test suite."""
20
25
  return os.getenv('FULL_TEST', '0') == '1'
@@ -204,6 +209,18 @@ def withPackage(*args: str) -> Callable:
204
209
  return decorator
205
210
 
206
211
 
212
+ def onlyRAG(func: Callable) -> Callable:
213
+ r"""A decorator to specify that this function belongs to the RAG test
214
+ suite.
215
+ """
216
+ import pytest
217
+ func = pytest.mark.rag(func)
218
+ return pytest.mark.skipif(
219
+ not is_rag_test(),
220
+ reason="RAG tests are disabled",
221
+ )(func)
222
+
223
+
207
224
  def withCUDA(func: Callable) -> Callable:
208
225
  r"""A decorator to test both on CPU and CUDA (if available)."""
209
226
  import pytest
@@ -1,6 +1,7 @@
1
+ from torch.nn import Module
2
+
1
3
  from torch_geometric.data import Data
2
4
  from torch_geometric.data.datapipes import functional_transform
3
- from torch_geometric.nn.models.gpse import GPSE
4
5
  from torch_geometric.transforms import BaseTransform, VirtualNode
5
6
 
6
7
 
@@ -13,7 +14,7 @@ class AddGPSE(BaseTransform):
13
14
  the actual encodings.
14
15
 
15
16
  Args:
16
- model (GPSE): The pre-trained GPSE model.
17
+ model (Module): The pre-trained GPSE model.
17
18
  use_vn (bool, optional): Whether to use virtual nodes.
18
19
  (default: :obj:`True`)
19
20
  rand_type (str, optional): Type of random features to use. Options are
@@ -21,7 +22,7 @@ class AddGPSE(BaseTransform):
21
22
  (default: :obj:`NormalSE`)
22
23
 
23
24
  """
24
- def __init__(self, model: GPSE, use_vn: bool = True,
25
+ def __init__(self, model: Module, use_vn: bool = True,
25
26
  rand_type: str = 'NormalSE'):
26
27
  self.model = model
27
28
  self.use_vn = use_vn