a = torch.tensor([10,20,30]).repeat(10).reshape(10,3) # n=10, k=3
b = torch.tensor([5,4,3,2,1]).repeat(3).reshape(3,5) #m=5
aT = a.unsqueeze(0) # adds a z-dimension
bTR = b.T.reshape(m, 1, k) 
result = aT - bTR # [m,n,k]