parameters: (seq1, seq2)
return_statement: return cross_mask
docstring: get matching matrix mask, for two sequences( id-sequences or vector-sequences)
docstring_summary: get matching matrix mask, for two sequences( id-sequences or vector-sequences)
docstring_tokens: get matching matrix mask for two sequences ( id - sequences or vector - sequences )
function: def get_cross_mask(seq1, seq2):
      """
      get matching matrix mask, for two sequences( id-sequences or vector-sequences)
      """
      length1 = seq_length(seq1)
      length2 = seq_length(seq2)
      max_len1 = tf.shape(seq1)[1]
      max_len2 = tf.shape(seq2)[1]
      ##for padding left
      mask1 = tf.sequence_mask(length1, max_len1, dtype=tf.int32)
      mask2 = tf.sequence_mask(length2, max_len2, dtype=tf.int32)
      cross_mask = tf.einsum('ij,ik->ijk', mask1, mask2)
      return cross_mask
function_tokens: def get_cross_mask ( seq1 , seq2 ) : length1 = seq_length ( seq1 ) length2 = seq_length ( seq2 ) max_len1 = tf . shape ( seq1 ) [ 1 ] max_len2 = tf . shape ( seq2 ) [ 1 ] ##for padding left mask1 = tf . sequence_mask ( length1 , max_len1 , dtype = tf . int32 ) mask2 = tf . sequence_mask ( length2 , max_len2 , dtype = tf . int32 ) cross_mask = tf . einsum ( 'ij,ik->ijk' , mask1 , mask2 ) return cross_mask