class_docstr: Base test class for checkpointing datasets.
class_docstr_tok: ["Base","test","class","for","checkpointing","datasets","."]
docstr: Verifies that ds_fn() produces the same outputs with and without breaks.
  
  1. Builds a Dataset using `ds_fn` and produces `num_outputs` items from it
     *without* stopping at break points.
  2. Builds a Dataset using `ds_fn` and produces `num_outputs` items from it
     with stopping at break points.
  
  Deep matches outputs from 1 and 2.
  
  Args:
    ds_fn: 0-argument function that returns a Dataset.
    break_points: A list of integers. For each `break_point` in
      `break_points`, we produce outputs till `break_point` number of items
      have been produced and then checkpoint the state. The current graph and
      session are destroyed and a new graph and session are used to produce
      outputs till next checkpoint or till `num_outputs` elements have been
      produced. `break_point` must be <= `num_outputs`.
    num_outputs: Total number of outputs expected from this Dataset.
    sparse_tensors: Whether dataset is built from SparseTensor(s).
    verify_exhausted: Whether to verify that the iterator has been exhausted
      after producing `num_outputs` elements.
    assert_items_equal: Tests the output has the expected elements regardless
      of order.
  
  Raises:
    AssertionError if any test fails.
docstr_tok: ["Verifies","that","ds_fn","(",")","produces","the","same","outputs","with","and","without","breaks",".","1",".","Builds","a","Dataset","using","`","ds_fn","`","and","produces","`","num_outputs","`","items","from","it","*","without","*","stopping","at","break","points",".","2",".","Builds","a","Dataset","using","`","ds_fn","`","and","produces","`","num_outputs","`","items","from","it","with","stopping","at","break","points",".","Deep","matches","outputs","from","1","and","2",".","Args",":","ds_fn",":","0-argument","function","that","returns","a","Dataset",".","break_points",":","A","list","of","integers",".","For","each","`","break_point","`","in","`","break_points","`",",","we","produce","outputs","till","`","break_point","`","number","of","items","have","been","produced","and","then","checkpoint","the","state",".","The","current","graph","and","session","are","destroyed","and","a","new","graph","and","session","are","used","to","produce","outputs","till","next","checkpoint","or","till","`","num_outputs","`","elements","have","been","produced",".","`","break_point","`","must","be","<","=","`","num_outputs","`",".","num_outputs",":","Total","number","of","outputs","expected","from","this","Dataset",".","sparse_tensors",":","Whether","dataset","is","built","from","SparseTensor","(","s",")",".","verify_exhausted",":","Whether","to","verify","that","the","iterator","has","been","exhausted","after","producing","`","num_outputs","`","elements",".","assert_items_equal",":","Tests","the","output","has","the","expected","elements","regardless","of","order",".","Raises",":","AssertionError","if","any","test","fails","."]
code: def verify_run_with_breaks(
      self,
      ds_fn,
      break_points,
      num_outputs,
      sparse_tensors=False,
      verify_exhausted=True,
      assert_items_equal=False,
  ):
      """Verifies that ds_fn() produces the same outputs with and without breaks.
  
      1. Builds a Dataset using `ds_fn` and produces `num_outputs` items from it
         *without* stopping at break points.
      2. Builds a Dataset using `ds_fn` and produces `num_outputs` items from it
         with stopping at break points.
  
      Deep matches outputs from 1 and 2.
  
      Args:
        ds_fn: 0-argument function that returns a Dataset.
        break_points: A list of integers. For each `break_point` in
          `break_points`, we produce outputs till `break_point` number of items
          have been produced and then checkpoint the state. The current graph and
          session are destroyed and a new graph and session are used to produce
          outputs till next checkpoint or till `num_outputs` elements have been
          produced. `break_point` must be <= `num_outputs`.
        num_outputs: Total number of outputs expected from this Dataset.
        sparse_tensors: Whether dataset is built from SparseTensor(s).
        verify_exhausted: Whether to verify that the iterator has been exhausted
          after producing `num_outputs` elements.
        assert_items_equal: Tests the output has the expected elements regardless
          of order.
  
      Raises:
        AssertionError if any test fails.
      """
      expected = self.gen_outputs(
          ds_fn,
          [],
          num_outputs,
          sparse_tensors=sparse_tensors,
          verify_exhausted=verify_exhausted,
      )
  
      actual = self.gen_outputs(
          ds_fn,
          break_points,
          num_outputs,
          sparse_tensors=sparse_tensors,
          verify_exhausted=verify_exhausted,
      )
  
      self.match(
          expected, actual, assert_items_equal=assert_items_equal
      )
  
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 8 for calling the CheckpointTestBase obj's underlying member method code with example usage: obj.verify_run_with_breaks(ds_fn, break_points, num_outputs, sparse_tensors, verify_exhausted, assert_items_equal) without return types