original_docstring: Combine two mask with multiplication or logical and.
  
      Parameters
      -----------
      mask1 : Tensor
          The first mask.
      mask2 : Tensor
          The second mask with broadcastable shape with ``mask1``.
      Returns
      --------
      Tensor
          Combined mask.
  
      Notes
      ------
      It is mainly used to combine the padding mask and no future mask for
      transformer decoder. 
  
      Padding mask is used to mask padding positions of the decoder inputs and
      no future mask is used to prevent the decoder to see future information.
      
docstring: Combine two mask with multiplication or logical and.
  Parameters
  
  mask1 : Tensor
  The first mask.
  mask2 : Tensor
  The second mask with broadcastable shape with ``mask1``.
  Returns
  
  Tensor
  Combined mask.
  
  Notes
  
  It is mainly used to combine the padding mask and no future mask for
  transformer decoder.
  
  Padding mask is used to mask padding positions of the decoder inputs and
  no future mask is used to prevent the decoder to see future information.
docstring_tokens: Combine two mask with multiplication or logical and . Parameters mask1 : Tensor The first mask . mask2 : Tensor The second mask with broadcastable shape with ` ` mask1 ` ` . Returns Tensor Combined mask . Notes It is mainly used to combine the padding mask and no future mask for transformer decoder . Padding mask is used to mask padding positions of the decoder inputs and no future mask is used to prevent the decoder to see future information .
code: def combine_mask(mask1, mask2):
      """Combine two mask with multiplication or logical and.
  
      Parameters
      -----------
      mask1 : Tensor
          The first mask.
      mask2 : Tensor
          The second mask with broadcastable shape with ``mask1``.
      Returns
      --------
      Tensor
          Combined mask.
  
      Notes
      ------
      It is mainly used to combine the padding mask and no future mask for
      transformer decoder. 
  
      Padding mask is used to mask padding positions of the decoder inputs and
      no future mask is used to prevent the decoder to see future information.
      """
      if mask1.dtype == paddle.fluid.core.VarDesc.VarType.BOOL:
          return paddle.logical_and(mask1, mask2)
      else:
          return mask1 * mask2
code_tokens: def combine_mask ( mask1 , mask2 ) : if mask1 . dtype == paddle . fluid . core . VarDesc . VarType . BOOL : return paddle . logical_and ( mask1 , mask2 ) else : return mask1 * mask2
short_docstring: Combine two mask with multiplication or logical and.
short_docstring_tokens: Combine two mask with multiplication or logical and .
comment: """Combine two mask with multiplication or logical and.
  
      Parameters
      -----------
      mask1 : Tensor
          The first mask.
      mask2 : Tensor
          The second mask with broadcastable shape with ``mask1``.
      Returns
      --------
      Tensor
          Combined mask.
  
      Notes
      ------
      It is mainly used to combine the padding mask and no future mask for
      transformer decoder. 
  
      Padding mask is used to mask padding positions of the decoder inputs and
      no future mask is used to prevent the decoder to see future information.
      """