PyTorch的torch.transpose功能仅转换2D输入.文档在这里.
torch.transpose
另一方面,Tensorflow的tf.transpose功能允许您转置N任意尺寸的张量.
tf.transpose
N
有人可以解释为什么PyTorch没有/不能具有N维转置功能吗?这是否是由于PyTorch中的计算图构造与Tensorflow的Define-then-Run范式的动态特性?
torch pytorch
pytorch ×1
torch ×1