'Compute classification loss from embedding.
Args:
embedded: 3-D float Tensor [batch_size, num_timesteps, embedding_dim]
inputs: VatxtInput, defaults to self.cl_inputs.
return_intermediates: bool, whether to return intermediate tensors or only
the final loss.
Returns:
If return_intermediates is True:
lstm_out, next_state, logits, loss
Else:
loss'

def cl_loss_from_embedding(self, embedded, inputs=None, return_intermediates=False):

    if (inputs is None):
        inputs = self.cl_inputs
    (lstm_out, next_state) = self.layers['lstm'](embedded, inputs.state, inputs.length)
    logits = self.layers['cl_logits'](lstm_out)
    loss = layers_lib.classification_loss(logits, inputs.labels, inputs.weights)
    if return_intermediates:
        return (lstm_out, next_state, logits, loss)
    else:
        return loss
