单选题
下列程序段能将⼀个4x4的张量resize成⼀个⼀维张量的是( )。
A
x = torch.randn(4, 4) y = x.view(16)
print(x.size(),y.size())
B
x = torch.randn(4, 4) y = x.view(4,4)
print(x.size(),y.size())
C
x = torch.randn(4, 4) y = x.view(2,8)
print(x.size(),y.size())
D
x = torch.randn(4, 4) y = x.view(8,2)
print(x.size(),y.size())
答案解析
正确答案:A
