pytorch的einsum
# -*- coding: utf-8 -*-import torch# 转置a = torch.arange(6).reshape(2, 3)print('a:{}'.format(a))b = torch.einsum('ij->ji', [a])print(b.size())print(b)# 求和b = torch.einsum('ij->', [a])...