[libtorch]common api
目录
tensor::Tensor
init tensor
tensor attribute
基本操作
tensor::Tensor
init tensor
torch::Tensor b = torch::zeros({2,3}); // 2x3的全0张量
torch::Tensor b = torch::ones({2,3}); // 2x3的全1张量
torch::Tensor b = torch::eye(5); // 5x5的张量,对角线为1,其余.
原创
2022-03-21 14:24:53 ·
2061 阅读 ·
0 评论