untimeError: scatter_add() expected at most 5 argument(s) but received 6 argument(s).

RuntimeError: scatter_add() expected at most 5 argument(s) but received 6 argument(s). Declaration: scatter_add(Tensor src, Tensor index, int dim=-1, Tensor? out=None, int? dim_size=None) -> (Tensor)

代码位置:
在这里插入图片描述

代码错误定位到这一行:

out = op(src, index, 0, None, dim_size, fill_value)

对比提示的Declaration: scatter_add(Tensor src, Tensor index, int dim=-1, Tensor? out=None, int? dim_size=None) -> (Tensor)
最后一个参数fill-value没有了。
修改调用方式:

 out = op(src, index, 0, None, dim_size)

代码跑通了。

你可能感兴趣的:(python,pytorch,torch_scatter)