初次学习用于记录
1.转置
Bij = Aij
import torch
import tsensor
h = torch.Tensor([[1,2],[3,4]])
with tsensor.clarify():
h = torch.einsum('ij->ji',h)
print(h)
输出:tensor([[1., 3.], [2., 4.]])
2.全部元素求和
h
初次学习用于记录
1.转置
Bij = Aij
import torch
import tsensor
h = torch.Tensor([[1,2],[3,4]])
with tsensor.clarify():
h = torch.einsum('ij->ji',h)
print(h)
输出:tensor([[1., 3.], [2., 4.]])
2.全部元素求和
h