-
Dear administrator and friends: x_j or x_i is usually in function 'def message(self, x_j: Tensor)' class myGraphConv(MessagePassing):
def __init__(
self,
in_channels: Union[int, Tuple[int, int]],
out_channels: int,
aggr: str = 'add',
bias: bool = True,
**kwargs,
):
super().__init__(aggr=aggr, **kwargs)
self.in_channels = in_channels
self.out_channels = out_channels
self.reset_parameters()
def reset_parameters(self):
self.lin_rel.reset_parameters()
self.lin_root.reset_parameters()
def forward(self, x: Union[Tensor, OptPairTensor], edge_index: Adj,
edge_weight: OptTensor = None, size: Size = None) -> Tensor:
if isinstance(x, Tensor):
x: OptPairTensor = (x, x)
"""
I want get x_j here
"""
return x_j |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
Dec 1, 2022
Replies: 1 comment 1 reply
-
You can do |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
benluejue
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do
x_j = x[edge_index[0]]
to make it available inforward
.