I had to drop the reassignment in order to avoid the error in my further experiments. I am sure that error happens at the following lines.
with torch.no_grad():
    self.W_hat.div_(torch.norm(self.W_hat, dim=5, keepdim=True))
    self.W_theta.fmod_(math.pi)

I will try to write a small snippet for reproduction in coming weeks, I only have one computer with gpu and that is working atm  Sharing a and x would not help you, there are several steps before I use w_theta_sin I need to simplify it to make it easier for you to trace it.
I think this issue is also related, but I am using 1.1.0:

  
      github.com/pytorch/pytorch
  
  
    



Issue: Assertion fails when using DataParallel with two nn.Embedding  23


	
	opened by neocheema
	on 2018-11-26
	
	
	closed by yf225
	on 
	


🐛 Bug
I'm using the nightly build: 1.0.0.dev20181123. This issue is very similar to #13569 . When I instantiate two nn.Embedding, with...


 	high priority
 	module: autograd
 	triaged


  
  
    
    
  
  


Thanks for asking,