!!!Libtorch 头文件顺序
#include <torch/script.h>
#include <torch/torch.h>
#include <iostream>
放在所有头文件最前面,避免出错
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<Scalar>& opt_ord, OptionalIntArrayRef opt_dim, bool keepdim, optional<ScalarType> opt_dtype) {