I initially created
input_features = {
ntype: blocks[0].srcdata['feature'][ntype]
for ntype in blocks[0].ntypes
}
which is
{'disease': tensor([[-5.1274e-02, 2.6597e-02, -1.2490e-16, ..., -1.8296e-02,
-2.0168e-02, -1.1136e-02],
...,
[-7.0330e-01, -5.1164e-01, 4.9960e-16, ..., 6.5890e-02,
1.1018e-01, -4.0044e-01]]), 'drug': tensor([[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 0., 0., 0.]]), 'protein': tensor([[-0.1390, -0.1390, -0.0860, ..., 1.7840, 1.7840, 1.7840],
...,
[ 0.8630, 0.8630, -2.8150, ..., 0.4730, 0.4730, 0.4730]])}
I pass these input_features
to the model where they are used as the second parameter in the forward:
Now when I call âinputsâ in the forward method of the RelGraphConv, this is the value:
ParameterDict(
(disease): Parameter containing: [torch.FloatTensor of size 24x348]
(drug): Parameter containing: [torch.FloatTensor of size 50x348]
(protein): Parameter containing: [torch.FloatTensor of size 372x348]
)
Then, the inputs
is being passed to the CustomHeteroGraphConv
in the end and when I check the value of the second parameter h
in the forward function, I receive this:
>>> h
(Parameter containing:
tensor([[-0.0417, 0.0290, -0.0552, ..., 0.1027, -0.1511, -0.0123],
...,
[ 0.0842, -0.1540, 0.0074, ..., 0.0233, 0.0525, -0.0698]],
requires_grad=True), tensor([[-0.1006, -0.1324, -0.0903, ..., 0.0811, -0.0562, 0.1083],
...,
[-0.0921, -0.1670, -0.1631, ..., -0.0653, 0.0133, 0.0732]],
grad_fn=<SliceBackward>))