(inp, tar)
return enc_padding_mask, combined_mask, dec_padding_mask
create encode and decode mask
create encode and decode mask
create encode and decode mask
def create_masks(inp, tar):
  """
  create encode and decode mask
  """
  # encoder self-attention mask
  enc_padding_mask = create_padding_mask(inp)
  # decoder self-attention mask
  dec_padding_mask = create_padding_mask(inp)

  # decoder context mask
  look_ahead_mask = create_look_ahead_mask(tf.shape(tar)[1])
  dec_target_padding_mask = create_padding_mask(tar)
  combined_mask = tf.maximum(dec_target_padding_mask, look_ahead_mask)

  return enc_padding_mask, combined_mask, dec_padding_mask
def create_masks ( inp , tar ) : # encoder self-attention mask enc_padding_mask = create_padding_mask ( inp ) # decoder self-attention mask dec_padding_mask = create_padding_mask ( inp ) # decoder context mask look_ahead_mask = create_look_ahead_mask ( tf . shape ( tar ) [ 1 ] ) dec_target_padding_mask = create_padding_mask ( tar ) combined_mask = tf . maximum ( dec_target_padding_mask , look_ahead_mask ) return enc_padding_mask , combined_mask , dec_padding_mask