C++ Libtorch 头文件问题

C++ Libtorch 头文件问题,第1张

!!!Libtorch 头文件顺序
#include 
#include 
#include 

放在所有头文件最前面,避免出错

libtorch/include/ATen/DeviceGuard.h:25:8: error: reference to 'optional' is ambiguous

libtorch/include/ATen/DeviceGuard.h:26:49: error: reference to 'nullopt' is ambiguous

return t.has_value() ? device_of(t.value()) : nullopt;

libtorch/include/torch/csrc/api/include/torch/linalg.h:103:76: error: reference to 'Scalar' is ambiguous

inline Tensor& norm_out(Tensor& result, const Tensor& self, const optional& opt_ord, OptionalIntArrayRef opt_dim, bool keepdim, optional opt_dtype) {

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/875337.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存