PyTorch 中打印 Tensor 维度:state.shape 的用法
使用 print 函数打印 state 的维度,代码如下:
print(state.shape)
其中,state.shape 表示 state 的维度信息。输出结果为:
torch.Size([batch_size, channels, height, width])
其中,batch_size=1,channels=1,height=4,width=4。
原文地址: https://www.cveoy.top/t/topic/m6Ix 著作权归作者所有。请勿转载和采集!