code: def _get_batch_accuracy_metrics(
      batch_logits: np.ndarray, batch_labels: np.ndarray
  ) -> Tuple[float, float]:
      """Returns the number of correct predictions, total number of predictions for a batch.
  
      Args:
        batch_logits: Logits returned by a seq2seq model, dim = (num_sequences,
          num_tokens, vocab_size).
        batch_labels: Target labels for the seq2seq model, dim = (num_sequences,
          num_tokens, 1).
      """
      batch_correct_preds = 0.0
      batch_total_preds = 0.0
      for sequence_logits, sequence_labels in zip(
          batch_logits, batch_labels
      ):
          preds = tf.metrics.sparse_categorical_accuracy(
              tf.keras.backend.constant(sequence_labels),
              tf.keras.backend.constant(sequence_logits),
          )
          if tf.executing_eagerly():
              batch_correct_preds += preds.numpy().sum()
          else:
              batch_correct_preds += tf.reduce_sum(preds)
          batch_total_preds += len(sequence_labels)
  
      if not tf.executing_eagerly():
          session = tf.compat.v1.Session()
          batch_correct_preds = batch_correct_preds.eval(
              session
          )  # pytype: disable=attribute-error
      return batch_correct_preds, batch_total_preds
  
imports: import dataclasses
  from typing import Iterator, List, Optional, Tuple
  import numpy
  from scipy import stats
  import tensorflow
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack import membership_inference_attack
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackInputData
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackResults
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackType
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import PrivacyReportMetadata
label_desc: Use image node_id 6 for calling a global function with example usage: _get_batch_accuracy_metrics(batch_logits, batch_labels) and returns: batch_correct_preds,  batch_total_preds