def compare_generating_steps(target_decode_steps, predicted_decode_steps):
  """Compare generating steps only but ignoring target copying steps.

  Args:
    target_decode_steps: Target DecodeSteps, Each tensor is expected to be shape
      [batch_size, output_length].
    predicted_decode_steps: Predicted DecodeSteps, Each tensor is expected to be
      shape [batch_size, output_length].

  Returns:
    A tensor of bools indicating whether generating steps are equal.
    Copy Steps will have value True.
  """
  # Set all copying steps to True, Since we only care about generating steps.
  return tf.logical_or(
      tf.not_equal(target_decode_steps.action_types, constants.GENERATE_ACTION),
      tf.logical_and(
          tf.equal(target_decode_steps.action_types,
                   predicted_decode_steps.action_types),
          tf.equal(target_decode_steps.action_ids,
                   predicted_decode_steps.action_ids)))
Compare generating steps only but ignoring target copying steps.

  Args:
    target_decode_steps: Target DecodeSteps, Each tensor is expected to be shape
      [batch_size, output_length].
    predicted_decode_steps: Predicted DecodeSteps, Each tensor is expected to be
      shape [batch_size, output_length].

  Returns:
    A tensor of bools indicating whether generating steps are equal.
    Copy Steps will have value True.
  
language/xsp/model/decode_utils.py