问题描述
以下代码的行为不符合预期,即无法更新t
:
Eigen::Tensor<float,3> t(2,3,4);
t.setZero();
t.chip(/*offset=*/0,/*dim=*/1).chip(/*offset=*/1,/*dim=*/2) +=
t.chip(/*offset=*/0,/*dim=*/2).constant(1.0);
如果没有链接,t
将被更新:
t.chip(/*offset=*/1,/*dim=*/0) *=
t.chip(/*offset=*/1,/*dim=*/0).constant(0.5);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)