Based on the discussion here,

  
      github.com/pytorch/pytorch
  
  
    



Issue: Efficient forward pass in nn.Linear 22


	
	opened by yunjey
	on 2017-07-20
	
	
	closed by soumith
	on 2017-07-20
	


Hi,
Maybe we can improve the operation speed in nn.Linear.
nn.Linear creates a weight matrix of shape (out_features, in_features) as you can see...




  
  
    
    
  
  


I think the shape pf weight matrix in linear layer should be reverse.
change:
self.linear1.weight = torch.nn.Parameter(torch.zeros(D_in,H))
to
self.linear1.weight = torch.nn.Parameter(torch.zeros(H,D_in))