From 41e542f63dd91778395fa59575a09b08d20de640 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 23 Jun 2022 12:54:12 +0200 Subject: [PATCH 1/3] update --- docs/source/notes/jit.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/source/notes/jit.rst b/docs/source/notes/jit.rst index 76999da5dcc1..45b026f546ae 100644 --- a/docs/source/notes/jit.rst +++ b/docs/source/notes/jit.rst @@ -99,7 +99,8 @@ However, if you want your own GNN module to be jittable, you need to account for def forward(self, x: Tensor, edge_index: Tensor, edge_weight: Optional[Tensor]) -> Tensor: - return self.propagate(edge_index, x=x, edge_weight=edge_weight) + return self.propagate(edge_index, x=x, edge_weight=edge_weight, + size=None) 2. Declaring the type of propagation arguments as a comment anywhere inside your module: @@ -115,4 +116,9 @@ However, if you want your own GNN module to be jittable, you need to account for edge_weight: Optional[Tensor]) -> Tensor: # propagate_type: (x: Tensor, edge_weight: Optional[Tensor]) - return self.propagate(edge_index, x=x, edge_weight=edge_weight) + return self.propagate(edge_index, x=x, edge_weight=edge_weight, + size=None) + +.. warning:: + + Importantly, due to TorchScript limitations, one also has to pass in the :obj:`size` attribute to :meth:`~torch_geometric.nn.conv.message_passing.MessagePassing.propagate`. In most cases, this can be simply set to :obj:`None` in which case it will be automatically inferred. From 72f5cda548793caa1dc286ef58ffcbbff6fda2c3 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 23 Jun 2022 12:55:49 +0200 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff558764e23d..36f855cc0ee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ## [2.0.5] - 2022-MM-DD ### Added +- Added `size=None` explanation to jittable `MessagePassing` modules in the documentation ([#4850](https://github.com/pyg-team/pytorch_geometric/pull/4850)) - Added documentation to the `DataLoaderIterator` class ([#4838](https://github.com/pyg-team/pytorch_geometric/pull/4838)) - Added `GraphStore` support to `Data` and `HeteroData` ([#4816](https://github.com/pyg-team/pytorch_geometric/pull/4816)) - Added `FeatureStore` support to `Data` and `HeteroData` ([#4807](https://github.com/pyg-team/pytorch_geometric/pull/4807)) From 3b124e9f2116d94681aab451f878c10fec9523b5 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Thu, 23 Jun 2022 12:56:58 +0200 Subject: [PATCH 3/3] typo --- docs/source/notes/jit.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/notes/jit.rst b/docs/source/notes/jit.rst index 45b026f546ae..54891c910570 100644 --- a/docs/source/notes/jit.rst +++ b/docs/source/notes/jit.rst @@ -121,4 +121,5 @@ However, if you want your own GNN module to be jittable, you need to account for .. warning:: - Importantly, due to TorchScript limitations, one also has to pass in the :obj:`size` attribute to :meth:`~torch_geometric.nn.conv.message_passing.MessagePassing.propagate`. In most cases, this can be simply set to :obj:`None` in which case it will be automatically inferred. + Importantly, due to TorchScript limitations, one also has to pass in the :obj:`size` attribute to :meth:`~torch_geometric.nn.conv.message_passing.MessagePassing.propagate`. + In most cases, this can be simply set to :obj:`None` in which case it will be automatically inferred.