zjhellofss/kuiperdatawhale

[Question] course2 编译出错

Closed this issue · 1 comments

course2 在对tensor进行reshape操作的时候std::multiplies()会提示错误,应该是没有显式指定模板的类型导致的?

In member function ‘void kuiper_infer::Tensor<float>::Reshape(const std::vector<unsigned int>&, bool)’:
/home/deepz/kuiperdatawhale/course2/source/tensor.cpp:237:72: error: cannot deduce template arguments for ‘multiplies’ from ()
       std::accumulate(shapes.begin(), shapes.end(), 1, std::multiplies());

C++ 17 加入了自动推导函数模板参数以及类模板参数,库是基于C++17的,所以不会报错.