github.com/pytorch/pytorch
  
  
    
  
	  
  

  
    
      Transformer Encoder Layer with src_key_padding makes NaN 100
    

    
      
        opened 
        
          
        
        Aug 18, 2019
      
      

        
          closed 
        
          
        
        Aug 26, 2019
      
        

      
        
          
          JunhyunB
        
      
    
  



  I'm using PyTorch 1.3 and this is sample code for my example.
import torch
import torch.nn as nn
enc = nn.TransformerEncoderLayer(3,1)
model = nn.TransformerEncoder(enc, 6)
x...



    module: nn
    triaged


  
  
    
    
  
  


This solved the issue