torch常用操作总结

increase Dimension
torch.unsqueeze(1)
	
torch.unsqueeze(0)
torch.view()
arr[:, :, np.newaxis]

compute the avage pos:
torch_scatter
Pasted image 20240324153509.png
scatter(src,index.dim,reduce="means")(sum,mul,min,max,sum)

easy mistake
	torch.min include values and indices