class_docstr: TFTrainer is a simple but feature-complete training and eval loop for TensorFlow, optimized for 🤗 Transformers.
  
  Args:
      model ([`TFPreTrainedModel`]):
          The model to train, evaluate or use for predictions.
      args ([`TFTrainingArguments`]):
          The arguments to tweak training.
      train_dataset ([`~tf.data.Dataset`], *optional*):
          The dataset to use for training. The dataset should yield tuples of `(features, labels)` where `features`
          is a dict of input features and `labels` is the labels. If `labels` is a tensor, the loss is calculated by
          the model by calling `model(features, labels=labels)`. If `labels` is a dict, such as when using a
          QuestionAnswering head model with multiple targets, the loss is instead calculated by calling
          `model(features, **labels)`.
      eval_dataset ([`~tf.data.Dataset`], *optional*):
          The dataset to use for evaluation. The dataset should yield tuples of `(features, labels)` where `features`
          is a dict of input features and `labels` is the labels. If `labels` is a tensor, the loss is calculated by
          the model by calling `model(features, labels=labels)`. If `labels` is a dict, such as when using a
          QuestionAnswering head model with multiple targets, the loss is instead calculated by calling
          `model(features, **labels)`.
      compute_metrics (`Callable[[EvalPrediction], Dict]`, *optional*):
          The function that will be used to compute metrics at evaluation. Must take a [`EvalPrediction`] and return
          a dictionary string to metric values.
      tb_writer (`tf.summary.SummaryWriter`, *optional*):
          Object to write to TensorBoard.
      optimizers (`Tuple[tf.keras.optimizers.Optimizer, tf.keras.optimizers.schedules.LearningRateSchedule]`, *optional*):
          A tuple containing the optimizer and the scheduler to use. The optimizer default to an instance of
          [`tf.keras.optimizers.Adam`] if `args.weight_decay_rate` is 0 else an instance of [`AdamWeightDecay`]. The
          scheduler will default to an instance of [`tf.keras.optimizers.schedules.PolynomialDecay`] if
          `args.num_warmup_steps` is 0 else an instance of [`WarmUp`].
docstr: Returns the evaluation [`~tf.data.Dataset`].
  
  Args:
      eval_dataset ([`~tf.data.Dataset`], *optional*):
          If provided, will override *self.eval_dataset*. The dataset should yield tuples of `(features, labels)`
          where `features` is a dict of input features and `labels` is the labels. If `labels` is a tensor, the
          loss is calculated by the model by calling `model(features, labels=labels)`. If `labels` is a dict,
          such as when using a QuestionAnswering head model with multiple targets, the loss is instead calculated
          by calling `model(features, **labels)`.
  
  Subclass and override this method if you want to inject some custom behavior.
docstr_tok: ["Returns","the","evaluation","[","`","~tf.data.Dataset","`","]",".","Args",":","eval_dataset","(","[","`","~tf.data.Dataset","`","]",",","*","optional","*",")",":","If","provided",",","will","override","*","self.eval_dataset","*",".","The","dataset","should","yield","tuples","of","`","(","features",",","labels",")","`","where","`","features","`","is","a","dict","of","input","features","and","`","labels","`","is","the","labels",".","If","`","labels","`","is","a","tensor",",","the","loss","is","calculated","by","the","model","by","calling","`","model","(","features",",","labels=labels",")","`",".","If","`","labels","`","is","a","dict",",","such","as","when","using","a","QuestionAnswering","head","model","with","multiple","targets",",","the","loss","is","instead","calculated","by","calling","`","model","(","features",",","*","*","labels",")","`",".","Subclass","and","override","this","method","if","you","want","to","inject","some","custom","behavior","."]
code: def get_eval_tfdataset(
      self, eval_dataset: Optional[tf.data.Dataset] = None
  ) -> tf.data.Dataset:
      """
      Returns the evaluation [`~tf.data.Dataset`].
  
      Args:
          eval_dataset ([`~tf.data.Dataset`], *optional*):
              If provided, will override *self.eval_dataset*. The dataset should yield tuples of `(features, labels)`
              where `features` is a dict of input features and `labels` is the labels. If `labels` is a tensor, the
              loss is calculated by the model by calling `model(features, labels=labels)`. If `labels` is a dict,
              such as when using a QuestionAnswering head model with multiple targets, the loss is instead calculated
              by calling `model(features, **labels)`.
  
      Subclass and override this method if you want to inject some custom behavior.
      """
      if eval_dataset is None and self.eval_dataset is None:
          raise ValueError(
              "Trainer: evaluation requires an eval_dataset."
          )
  
      eval_dataset = (
          eval_dataset
          if eval_dataset is not None
          else self.eval_dataset
      )
      num_examples = eval_dataset.cardinality().numpy()
  
      if num_examples < 0:
          raise ValueError(
              "The training dataset must have an asserted cardinality"
          )
  
      approx = (
          math.floor if self.args.dataloader_drop_last else math.ceil
      )
      steps = approx(num_examples / self.args.eval_batch_size)
      ds = (
          eval_dataset.repeat()
          .batch(
              self.args.eval_batch_size,
              drop_remainder=self.args.dataloader_drop_last,
          )
          .prefetch(tf.data.experimental.AUTOTUNE)
      )
  
      return (
          self.args.strategy.experimental_distribute_dataset(ds),
          steps,
          num_examples,
      )
  
imports: import datetime
  import math
  import os
  import warnings
  from typing import Callable, Dict, Optional, Tuple
  from .utils import ENV_VARS_TRUE_VALUES
  from .integrations import is_comet_available, is_wandb_available
  import numpy
  import tensorflow
  from tensorflow.python.distribute.values import PerReplica
  from .modeling_tf_utils import TFPreTrainedModel
  from .optimization_tf import GradientAccumulator, create_optimizer
  from .trainer_utils import PREFIX_CHECKPOINT_DIR, EvalPrediction, IntervalStrategy, PredictionOutput, enable_full_determinism, set_seed
  from .training_args_tf import TFTrainingArguments
  from .utils import logging
label_desc: Use image node_id 3 for calling the TFTrainer obj's underlying member method code with example usage: obj.get_eval_tfdataset(eval_dataset) and returns: self,  steps,  num_examples