'Loss function for the seq2seq RNN.  Reshape predicted and true (label) tensors, generate dummy weights,
then use seq2seq.sequence_loss to actually compute the loss function.'

def sequence_loss(self, y_pred, y_true):

    if (self.verbose > 2):
        print(('my_sequence_loss    y_pred=%s,    y_true=%s' % (y_pred, y_true)))
    logits = tf.unstack(y_pred, axis=1)
    targets = tf.unstack(y_true, axis=1)
    if (self.verbose > 2):
        print(('my_sequence_loss    logits=%s' % (logits,)))
        print(('my_sequence_loss    targets=%s' % (targets,)))
    weights = [tf.ones_like(yp, dtype=tf.float32) for yp in targets]
    if (self.verbose > 4):
        print(('my_sequence_loss    weights=%s' % (weights,)))
    sl = seq2seq.sequence_loss(logits, targets, weights)
    if (self.verbose > 2):
        print(('my_sequence_loss    return    =    %s' % sl))
    return sl
