class_docstr: Sequence-to-sequence base class.
class_docstr_tok: ["Sequence-to-sequence","base","class","."]
docstr: Compute optimization loss.
docstr_tok: ["Compute","optimization","loss","."]
code: def _compute_loss(self, logits, decoder_cell_outputs):
      """Compute optimization loss."""
      target_output = self.iterator.target_output
      if self.time_major:
          target_output = tf.transpose(target_output)
      max_time = self.get_max_time(target_output)
  
      crossent = self._softmax_cross_entropy_loss(
          logits, decoder_cell_outputs, target_output
      )
  
      target_weights = tf.sequence_mask(
          self.iterator.target_sequence_length,
          max_time,
          dtype=self.dtype,
      )
      if self.time_major:
          target_weights = tf.transpose(target_weights)
  
      loss = tf.reduce_sum(crossent * target_weights) / tf.to_float(
          self.batch_size
      )
      return loss
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import collections
  import tensorflow
  from tensorflow.contrib.model_pruning import get_masks, get_thresholds
  from tensorflow.contrib.model_pruning.python import pruning
  from tensorflow.contrib.model_pruning.python.layers import core_layers
  from .None import model_helper
  from .utils import misc_utils, iterator_utils
label_desc: Use image node_id 19 for calling the BaseModel obj's underlying member method code with example usage: obj._compute_loss(logits, decoder_cell_outputs) and returns: loss