Skip to content
Discussion options

You must be logged in to vote

That is expected since the input types are not fully resolved yet (GCNConv can operate both on edge_index and SparseTensor). It is fixable by either:

  1. specifying the input types as additional argument to jittable:
import torch

from torch_geometric.nn import GCNConv

conv1 = GCNConv(16, 16)
conv1 = conv1.jittable('(Tensor, Tensor, OptTensor) -> Tensor')
print(torch.jit.script(conv1).graph)
  1. Wrapping your layer inside a module with clearly specified types:
class GCN(torch.nn.Module):
    def __init__(self, ...):
        super().__init__()
        self.conv1 = GCNConv(16, 16)
        
    def forward(self, x, edge_index):
        return self.conv1(x, edge_index)

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@rusty1s
Comment options

@rusty1s
Comment options

@gunabam
Comment options

@rusty1s
Comment options

Answer selected by gunabam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants