最佳答案
我有一个形状为 [4, 3, 966, 1296]的 PytorchTensor。我想用以下代码将其转换为 numpy阵列:
imgs = imgs.numpy()[:, ::-1, :, :]
那个代码是怎么工作的?