Note: this feature was merged  on Jan 23 - https://github.com/pytorch/pytorch/pull/31996 11 - and is not in the pip distribution of pytorch
EDIT: Note that this is available in the most recent pip release, 1.5: https://github.com/pytorch/pytorch/releases 6

  
      github.com/pytorch/pytorch
  
  
    
  
    
  

  
    
      Support 3D attention mask in MultiheadAttention. 11
    

    
      pytorch:master ← pytorch:3d_attn_mask
    

    
      
        opened 
        
          
        
        Jan 9, 2020
      
      

      
        
          
          zhangguanheng66
        
      

      
        
          +57
          -22