@parameterized.named_parameters(('1', np.int32([])), ('2', np.int32([1])), ('3', np.int32([1, 2, 3])))
def testWindowDatasetBatchSparseDynamicShape(self, shape):
    'Tests batching of dynamically shaped sparse tensor windows.\n\n    Args:\n      shape: the input shape\n    '
    shape_t = array_ops.placeholder(dtypes.int32)
    dataset = dataset_ops.Dataset.from_tensors(array_ops.zeros(shape_t)).map(self._make_dense_to_sparse_fn((len(shape) == 0))).repeat(5).apply(grouping.window_dataset(5)).apply(grouping._map_x_dataset(batching.batch_window))
    iterator = dataset.make_initializable_iterator()
    init_op = iterator.initializer
    get_next = iterator.get_next()
    with self.cached_session() as sess:
        sess.run(init_op, {shape_t: shape})
        expected = sess.run(self._structuredSparseElement(None, np.concatenate(([5], shape), axis=0), dtypes.int32))
        actual = sess.run(get_next)
        self._assertEqual(expected, actual)
Tests batching of dynamically shaped sparse tensor windows.

Args:
  shape: the input shape
@parameterized.named_parameters(('1', np.int32([])), ('2', np.int32([1])), ('3', np.int32([1, 2, 3])))
def testWindowDatasetBatchSparseDynamicShape(self, shape):
    'Tests batching of dynamically shaped sparse tensor windows.\n\n    Args:\n      shape: the input shape\n    '
    shape_t = array_ops.placeholder(dtypes.int32)
    dataset = dataset_ops.Dataset.from_tensors(array_ops.zeros(shape_t)).map(self._make_dense_to_sparse_fn((len(shape) == 0))).repeat(5).apply(grouping.window_dataset(5)).apply(grouping._map_x_dataset(batching.batch_window))
    iterator = dataset.make_initializable_iterator()
    init_op = iterator.initializer
    get_next = iterator.get_next()
    with self.cached_session() as sess:
        sess.run(init_op, {shape_t: shape})
        expected = sess.run(self._structuredSparseElement(None, np.concatenate(([5], shape), axis=0), dtypes.int32))
        actual = sess.run(get_next)
        self._assertEqual(expected, actual)