MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / __init__

Method __init__

tensorflow/python/data/ops/dataset_ops.py:3772–3798  ·  view source on GitHub ↗

See `window_dataset()` for more details.

(self, input_dataset, size, shift, stride, drop_remainder)

Source from the content-addressed store, hash-verified

3770 """A dataset that creates window datasets from the input elements."""
3771
3772 def __init__(self, input_dataset, size, shift, stride, drop_remainder):
3773 """See `window_dataset()` for more details."""
3774 self._input_dataset = input_dataset
3775 self._size = ops.convert_to_tensor(size, dtype=dtypes.int64, name="size")
3776 self._shift = ops.convert_to_tensor(shift, dtype=dtypes.int64, name="shift")
3777 self._stride = ops.convert_to_tensor(
3778 stride, dtype=dtypes.int64, name="stride")
3779 self._drop_remainder = ops.convert_to_tensor(
3780 drop_remainder, dtype=dtypes.bool, name="drop_remainder")
3781 self._structure = nest.pack_sequence_as(
3782 get_legacy_output_classes(input_dataset), [
3783 DatasetSpec( # pylint: disable=g-complex-comprehension
3784 structure.convert_legacy_structure(
3785 output_type, output_shape, output_class))
3786 for output_class, output_shape, output_type in zip(
3787 nest.flatten(get_legacy_output_classes(input_dataset)),
3788 nest.flatten(get_legacy_output_shapes(input_dataset)),
3789 nest.flatten(get_legacy_output_types(input_dataset)))
3790 ])
3791 variant_tensor = gen_dataset_ops.window_dataset(
3792 input_dataset._variant_tensor, # pylint: disable=protected-access
3793 self._size,
3794 self._shift,
3795 self._stride,
3796 self._drop_remainder,
3797 **self._flat_structure)
3798 super(WindowDataset, self).__init__(input_dataset, variant_tensor)
3799
3800 @property
3801 def element_spec(self):

Callers

nothing calls this directly

Calls 6

DatasetSpecClass · 0.85
get_legacy_output_shapesFunction · 0.85
get_legacy_output_typesFunction · 0.85
flattenMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected