形状变换
#include<torch/torch.h>
#include<iostream>
using std::cout; using std::endl;
int main()
{
auto b = torch::full({ 10 }, 3);
//cout << b << endl;
b = b.view({ 1,2,-1 });
//cout << b << endl;
auto c = b.transpose(0, 1);
//cout << c << endl;
auto d = b.reshape({ 1,1,-1 });
//cout << d << endl;
auto e = b.permute({ 1,0,2 });
cout << e << endl;
return 0;
}