class_docstr: Base test class for checkpointing datasets.
class_docstr_tok: ["Base","test","class","for","checkpointing","datasets","."]
docstr: Verifies that saving and restoring an exhausted iterator works.
  
  An exhausted iterator is one which has returned an OutOfRange error.
  
  Args:
    ds_fn: 0-argument function that returns a Dataset.
    num_outputs: Total number of outputs expected from this Dataset.
    sparse_tensors: Whether dataset is built from SparseTensor(s).
  
  Raises:
    AssertionError if any test fails.
docstr_tok: ["Verifies","that","saving","and","restoring","an","exhausted","iterator","works",".","An","exhausted","iterator","is","one","which","has","returned","an","OutOfRange","error",".","Args",":","ds_fn",":","0-argument","function","that","returns","a","Dataset",".","num_outputs",":","Total","number","of","outputs","expected","from","this","Dataset",".","sparse_tensors",":","Whether","dataset","is","built","from","SparseTensor","(","s",")",".","Raises",":","AssertionError","if","any","test","fails","."]
code: def verify_exhausted_iterator(
      self, ds_fn, num_outputs, sparse_tensors=False
  ):
      """Verifies that saving and restoring an exhausted iterator works.
  
      An exhausted iterator is one which has returned an OutOfRange error.
  
      Args:
        ds_fn: 0-argument function that returns a Dataset.
        num_outputs: Total number of outputs expected from this Dataset.
        sparse_tensors: Whether dataset is built from SparseTensor(s).
  
      Raises:
        AssertionError if any test fails.
      """
      self.gen_outputs(
          ds_fn,
          [],
          num_outputs,
          verify_exhausted=True,
          sparse_tensors=sparse_tensors,
      )
      actual = self.gen_outputs(
          ds_fn,
          [],
          0,
          ckpt_saved=True,
          verify_exhausted=True,
          sparse_tensors=sparse_tensors,
      )
      self.assertLen(actual, 0)
  
imports: import os
  import numpy
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import checkpoint_management
  from tensorflow.python.checkpoint import checkpoint_options
  from tensorflow.python.data.experimental.ops import iterator_ops
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import options
  from tensorflow.python.eager import context
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import lookup_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops.ragged import ragged_tensor_value
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import test
  from tensorflow.python.training import saver
  from tensorflow.python.util import nest
label_desc: Use image node_id 4 for calling the CheckpointTestBase obj's underlying member method code with example usage: obj.verify_exhausted_iterator(ds_fn, num_outputs, sparse_tensors) without return types