(logits,
                       labels,
                       input_length,
                       label_length,
                       smoothing=0.0)
return loss
softmax cross entropy loss for sequence to sequence
  :param logits: [batch_size, max_seq_len, vocab_size]
  :param labels: [batch_size, max_seq_len]
  :param input_length: [batch_size]
  :param label_length: [batch_size]
  :return: loss, scalar
softmax cross entropy loss for sequence to sequence
  :param logits: [batch_size, max_seq_len, vocab_size]
  :param labels: [batch_size, max_seq_len]
  :param input_length: [batch_size]
  :param label_length: [batch_size]
  :return: loss, scalar
softmax cross entropy loss for sequence to sequence : param logits : [ batch_size max_seq_len vocab_size ] : param labels : [ batch_size max_seq_len ] : param input_length : [ batch_size ] : param label_length : [ batch_size ] : return : loss scalar
def mask_sequence_loss(logits,
                       labels,
                       input_length,
                       label_length,
                       smoothing=0.0):
  '''
  softmax cross entropy loss for sequence to sequence
  :param logits: [batch_size, max_seq_len, vocab_size]
  :param labels: [batch_size, max_seq_len]
  :param input_length: [batch_size]
  :param label_length: [batch_size]
  :return: loss, scalar
  '''
  del smoothing
  del input_length

  if label_length is not None:
    weights = tf.cast(utils.len_to_mask(label_length), tf.float32)
  else:
    weights = tf.ones_like(labels)
  loss = tfa.seq2seq.loss.sequence_loss(logits, labels, weights)
  return loss
def mask_sequence_loss ( logits , labels , input_length , label_length , smoothing = 0.0 ) : del smoothing del input_length if label_length is not None : weights = tf . cast ( utils . len_to_mask ( label_length ) , tf . float32 ) else : weights = tf . ones_like ( labels ) loss = tfa . seq2seq . loss . sequence_loss ( logits , labels , weights ) return loss