pyg-nightly 2.7.0.dev20241111__py3-none-any.whl → 2.7.0.dev20241113__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.dev20241111
3
+ Version: 2.7.0.dev20241113
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=zixV3WisaNJLj2ys2odFv7wocaCbwFr4A8uxGnDc63A,1904
1
+ torch_geometric/__init__.py,sha256=Mca3sSBlw54VQCuXnQZuuiaMSeoXOxn1Rvj2mKD91tc,1904
2
2
  torch_geometric/_compile.py,sha256=REjj1_qX8YBrva6iqr3AsNiDueTAy2BhLZkdezKL2MY,1322
3
3
  torch_geometric/_onnx.py,sha256=V9ffrIKSqhDw6xUZ12lkuSfNs48cQp2EeJ6Z19GfnVw,349
4
4
  torch_geometric/backend.py,sha256=lVaf7aLoVaB3M-UcByUJ1G4T4FOK6LXAg0CF4W3E8jo,1575
@@ -32,7 +32,7 @@ torch_geometric/contrib/transforms/__init__.py,sha256=lrGnWsEiJf5zsBRmshGZZFN_uY
32
32
  torch_geometric/data/__init__.py,sha256=OLkV82AGm6xMSynT_DHfRE6_INfPxLx4BQnY0-WVn54,4323
33
33
  torch_geometric/data/batch.py,sha256=C9cT7-rcWPgnG68Eb_uAcn90HS3OvOG6n4fY3ihpFhI,8764
34
34
  torch_geometric/data/collate.py,sha256=RRiUMBLxDAitaHx7zF0qiMR2nW1NY_0uaNdxlUo5-bo,12756
35
- torch_geometric/data/data.py,sha256=6HeA8tSMAcjWDsJqtRDMC0mmgnvvHCUDWfIusA7ObBA,43445
35
+ torch_geometric/data/data.py,sha256=l_gHy18g9WtiSCm1mDinR4vGrZOLetogrw5wJEcn23E,43807
36
36
  torch_geometric/data/database.py,sha256=VTct1xyzXsK0GZahBV9-noviCzjRteAsKMG7VgJ52n0,22998
37
37
  torch_geometric/data/datapipes.py,sha256=9_Cq3j_7LIF4plQFzbLaqyy0LcpKdAic6yiKgMqSX9A,3083
38
38
  torch_geometric/data/dataset.py,sha256=TX2AM3OQkMLOx5Ie8IFtFFYuoA3AGeYwoT3ZqW56N7c,16768
@@ -517,7 +517,7 @@ torch_geometric/transforms/compose.py,sha256=P5AFGd6s9L-lpb8io1jKIm2LjAccp_6Q2Xo
517
517
  torch_geometric/transforms/constant.py,sha256=zDJbO1sEds1vjbRmgzSd-8D8gM4PtvWESuC-gX2qB9E,2005
518
518
  torch_geometric/transforms/delaunay.py,sha256=-7JIDKhjk8h1cFGVYiqRszwHFDf5dMzKOiB1ejUah_o,1273
519
519
  torch_geometric/transforms/distance.py,sha256=DvvI2vAYpxklnKCz3-4w2EXz7AYra0xBZ5m7MAL1tok,2360
520
- torch_geometric/transforms/face_to_edge.py,sha256=Gr0NwRtVwp51hkDJ2bQVkGbSs2k6ePrRiua3ZNt6-K8,1083
520
+ torch_geometric/transforms/face_to_edge.py,sha256=ohAWtpiCs_qHwrrYmz2eLvAcd_bhfPsxkpHdFnAZkhk,2144
521
521
  torch_geometric/transforms/feature_propagation.py,sha256=GPiKiGU7OuOpBBJeATlCtAtBUy_DSHUoBnJdDK8T81E,3056
522
522
  torch_geometric/transforms/fixed_points.py,sha256=sfcqHZSw542LIYmq1DrTJdyncDRa2Uxf5N50G5lYSfQ,2426
523
523
  torch_geometric/transforms/gcn_norm.py,sha256=INi8f8J3i2OXWgX5U4GNKROpcvJNW42qO39EdLPRPS8,1397
@@ -578,7 +578,7 @@ torch_geometric/utils/_negative_sampling.py,sha256=u-7oDg8luSFto-iUqsq7eC9uek6yq
578
578
  torch_geometric/utils/_normalize_edge_index.py,sha256=H6DY-Dzi1Psr3igG_nb0U3ZPNZz-BBDntO2iuA8FtzA,1682
579
579
  torch_geometric/utils/_normalized_cut.py,sha256=uwVJkl-Q0tpY-w0nvcHajcQYcqFh1oDOf55XELdjJBU,1167
580
580
  torch_geometric/utils/_one_hot.py,sha256=vXC7l7zudYRZIwWv6mT-Biuk2zKELyqteJXLynPocPM,1404
581
- torch_geometric/utils/_scatter.py,sha256=yWayqkSPs5G5tsku2HPxJaHcqFRaSaam_L70Gb-7Uwg,14594
581
+ torch_geometric/utils/_scatter.py,sha256=f8nSA_zZXO2YwKMnaGcx_Cz-11UdMxfck-hl0B6Mcng,14614
582
582
  torch_geometric/utils/_segment.py,sha256=CqS7_NMQihX89gEwFVHbyMEZgaEnSlJGpyuWqy3i8HI,1976
583
583
  torch_geometric/utils/_select.py,sha256=BZ5P6-1riR4xhCIJZnsNg5HmeAGelRzH42TpADj9xpQ,2439
584
584
  torch_geometric/utils/_softmax.py,sha256=6dTVbWX04laemRP-ZFPMS6ymRZtRa8zYF22QCXl_m4w,3242
@@ -616,8 +616,8 @@ torch_geometric/utils/smiles.py,sha256=4xTW56OWqvQcM5i2LEvsESAIvd2n0I17n9tvarHok
616
616
  torch_geometric/utils/sparse.py,sha256=uYd0oPrp5XN0c2Zc15f-00rhhVMfLnRMqNcqcmILNKQ,25519
617
617
  torch_geometric/utils/undirected.py,sha256=H_nfpI0_WluOG6VfjPyldvcjL4w5USAKWu2x5nUAUjw,6222
618
618
  torch_geometric/visualization/__init__.py,sha256=PyR_4K5SafsJrBr6qWrkjKr6GBL1b7FtZybyXCDEVwY,154
619
- torch_geometric/visualization/graph.py,sha256=AGKqbtTdL14w7xIhy6n3g4bpCOnujKt-pXHCNzovxB4,4784
619
+ torch_geometric/visualization/graph.py,sha256=ZuLPL92yGRi7lxlqsUPwL_EVVXF7P2kMcveTtW79vpA,4784
620
620
  torch_geometric/visualization/influence.py,sha256=CWMvuNA_Nf1sfbJmQgn58yS4OFpeKXeZPe7kEuvkUBw,477
621
- pyg_nightly-2.7.0.dev20241111.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
622
- pyg_nightly-2.7.0.dev20241111.dist-info/METADATA,sha256=iI2qoQgS9-zDN86zQuJjwdCON3Bf8YD3B7HAySrpqTg,62897
623
- pyg_nightly-2.7.0.dev20241111.dist-info/RECORD,,
621
+ pyg_nightly-2.7.0.dev20241113.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
622
+ pyg_nightly-2.7.0.dev20241113.dist-info/METADATA,sha256=mfvaeek9VqMAvaZRS0W_IUhuyVk-eQA3q3Mylf0w1u0,62897
623
+ pyg_nightly-2.7.0.dev20241113.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.dev20241111'
33
+ __version__ = '2.7.0.dev20241113'
34
34
 
35
35
  __all__ = [
36
36
  'Index',
@@ -659,7 +659,13 @@ class Data(BaseData, FeatureStore, GraphStore):
659
659
  return value.get_dim_size()
660
660
  return int(value.max()) + 1
661
661
  elif 'index' in key or key == 'face':
662
- return self.num_nodes
662
+ num_nodes = self.num_nodes
663
+ if num_nodes is None:
664
+ raise RuntimeError(f"Unable to infer 'num_nodes' from the "
665
+ f"attribute '{key}'. Please explicitly set "
666
+ f"'num_nodes' as an attribute of 'data' to "
667
+ f"prevent this error")
668
+ return num_nodes
663
669
  else:
664
670
  return 0
665
671
 
@@ -8,8 +8,15 @@ from torch_geometric.utils import to_undirected
8
8
 
9
9
  @functional_transform('face_to_edge')
10
10
  class FaceToEdge(BaseTransform):
11
- r"""Converts mesh faces :obj:`[3, num_faces]` to edge indices
12
- :obj:`[2, num_edges]` (functional name: :obj:`face_to_edge`).
11
+ r"""Converts mesh faces of shape :obj:`[3, num_faces]` or
12
+ :obj:`[4, num_faces]` to edge indices of shape :obj:`[2, num_edges]`
13
+ (functional name: :obj:`face_to_edge`).
14
+
15
+ This transform supports both 2D triangular faces, represented by a
16
+ tensor of shape :obj:`[3, num_faces]`, and 3D tetrahedral mesh faces,
17
+ represented by a tensor of shape :obj:`[4, num_faces]`. It will convert
18
+ these faces into edge indices, where each edge is defined by the indices
19
+ of its two endpoints.
13
20
 
14
21
  Args:
15
22
  remove_faces (bool, optional): If set to :obj:`False`, the face tensor
@@ -22,7 +29,29 @@ class FaceToEdge(BaseTransform):
22
29
  if hasattr(data, 'face'):
23
30
  assert data.face is not None
24
31
  face = data.face
25
- edge_index = torch.cat([face[:2], face[1:], face[::2]], dim=1)
32
+
33
+ if face.size(0) not in [3, 4]:
34
+ raise RuntimeError(f"Expected 'face' tensor with shape "
35
+ f"[3, num_faces] or [4, num_faces] "
36
+ f"(got {list(face.size())})")
37
+
38
+ if face.size()[0] == 3:
39
+ edge_index = torch.cat([
40
+ face[:2],
41
+ face[1:],
42
+ face[::2],
43
+ ], dim=1)
44
+ else:
45
+ assert face.size()[0] == 4
46
+ edge_index = torch.cat([
47
+ face[:2],
48
+ face[1:3],
49
+ face[2:4],
50
+ face[::2],
51
+ face[1::2],
52
+ face[::3],
53
+ ], dim=1)
54
+
26
55
  edge_index = to_undirected(edge_index, num_nodes=data.num_nodes)
27
56
 
28
57
  data.edge_index = edge_index
@@ -351,5 +351,5 @@ def group_cat(
351
351
  """
352
352
  assert len(tensors) == len(indices)
353
353
  index, perm = torch.cat(indices).sort(stable=True)
354
- out = torch.cat(tensors, dim=0)[perm]
354
+ out = torch.cat(tensors, dim=dim).index_select(dim, perm)
355
355
  return (out, index) if return_index else out
@@ -132,7 +132,7 @@ def _visualize_graph_via_networkx(
132
132
  xy=pos[src],
133
133
  xytext=pos[dst],
134
134
  arrowprops=dict(
135
- arrowstyle="->",
135
+ arrowstyle="<-",
136
136
  alpha=data['alpha'],
137
137
  shrinkA=sqrt(node_size) / 2.0,
138
138
  shrinkB=sqrt(node_size) / 2.0,