#include
#include
using namespace std;
// 张量 创建一个{3,4}的张量
auto b...= torch::rand({3,4});
std::cout创建的张量:"std::endl;
b.print();
// 创建张量
at::Tensor...torch
auto device = torch::Device(torch::kCUDA);
std::coutstd::endl;
//初始化张量的值...aa[4] = {1,2,3,4};
auto aaa = torch::from_blob(aa,{2,2},torch::kFloat);
//使用容器来初始化张量
vector...//求张量a第0维度的最大值
std::tupleTensor, torch::Tensor> max_classes = (torch::max)(atensor,