docstr: Tests a dataset that slides a window its input elements.
docstr_tok: ["Tests","a","dataset","that","slides","a","window","its","input","elements","."]
code: def testWindowDataset(
      self, count, size, shift, stride, drop_remainder
  ):
      """Tests a dataset that slides a window its input elements."""
      components = (
          np.arange(7),
          np.array([[1, 2, 3]]) * np.arange(7)[:, np.newaxis],
          np.array(37.0) * np.arange(7),
      )
  
      def _map_fn(x, y, z):
          return (
              math_ops.square(x),
              math_ops.square(y),
              math_ops.square(z),
          )
  
      def _flat_map_fn(x, y, z):
          return dataset_ops.Dataset.zip(
              (
                  x.batch(batch_size=size),
                  y.batch(batch_size=size),
                  z.batch(batch_size=size),
              )
          )
  
      dataset = (
          dataset_ops.Dataset.from_tensor_slices(components)
          .map(_map_fn)
          .repeat(count)
          .window(
              size=size,
              shift=shift,
              stride=stride,
              drop_remainder=drop_remainder,
          )
          .flat_map(_flat_map_fn)
      )
      get_next = self.getNext(dataset)
  
      self.assertEqual(
          [[None] + list(c.shape[1:]) for c in components],
          [
              ts.as_list()
              for ts in nest.flatten(
                  dataset_ops.get_legacy_output_shapes(dataset)
              )
          ],
      )
  
      num_full_batches = max(
          0, (count * 7 - ((size - 1) * stride + 1)) // shift + 1
      )
      for i in range(num_full_batches):
          result = self.evaluate(get_next())
          for component, result_component in zip(components, result):
              for j in range(size):
                  self.assertAllEqual(
                      component[(i * shift + j * stride) % 7] ** 2,
                      result_component[j],
                  )
      if not drop_remainder:
          num_partial_batches = (
              (count * 7) // shift
              + ((count * 7) % shift > 0)
              - num_full_batches
          )
          for i in range(num_partial_batches):
              result = self.evaluate(get_next())
              for component, result_component in zip(
                  components, result
              ):
                  remaining = (count * 7) - (
                      (num_full_batches + i) * shift
                  )
                  num_elements = remaining // stride + (
                      (remaining % stride) > 0
                  )
                  for j in range(num_elements):
                      self.assertAllEqual(
                          component[
                              (
                                  (num_full_batches + i) * shift
                                  + j * stride
                              )
                              % 7
                          ]
                          ** 2,
                          result_component[j],
                      )
      with self.assertRaises(errors.OutOfRangeError):
          self.evaluate(get_next())
      with self.assertRaises(errors.OutOfRangeError):
          self.evaluate(get_next())
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.kernel_tests import checkpoint_test_base
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.util import nest
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the WindowTest obj's underlying member method code with example usage: obj.testWindowDataset(count, size, shift, stride, drop_remainder) and returns: math_ops,  math_ops,  math_ops, dataset_ops