(一)scatter_add()报错

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

 代码出错在这一行:

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)

 

posted @ 2023-10-09 15:29  jasonzhangxianrong  阅读(66)  评论(0编辑  收藏  举报