import torch
a = torch.arange(10)
b = torch.arange(10)*10
print( a, b )
a+b
a.shape
a[None].shape
a[:,None].shape
c = a[:,None]
c.shape
c[:,0]
d = a[None]
d.shape
d[0]
d[0,:]
torch.ones([3,2]) + 10
torch.ones([3,2]) + torch.ones([2,3])
torch.ones([3,1]) + torch.ones([1,3])
a[None,:] + b[:,None]
a[None,:].repeat(10,1)
b[:,None].repeat(1,10)
a[None,:].repeat(10,1) + b[:,None].repeat(1,10)
a[None,:] * b[:,None]