
    BVh?                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 d Z G d	 d
ej                        Zy)z/The implementation of `tf.data.Dataset.window`.    )dataset_ops)nest)	structure)dtypes)ops)gen_dataset_opsc                 ,    ||}t        | |||||      S )N)name)_WindowDataset)input_datasetsizeshiftstridedrop_remainderr
   s         T/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/data/ops/window_op.py_windowr      s(    
]E	T5&.t
E E    c                   6     e Zd ZdZ	 d fd	Zed        Z xZS )r   z?A dataset that creates window datasets from the input elements.c                 (   || _         t        j                  |t        j                  d      | _        t        j                  |t        j                  d      | _        t        j                  |t        j                  d      | _        t        j                  |t        j                  d      | _	        t        j                  t        j                  |      t        t        j                  t        j                  |            t        j                  t        j                   |            t        j                  t        j"                  |                  D 	cg c]0  \  }}}	t        j$                  t'        j(                  |	||            2 c}	}}      | _        || _        t/        j0                  |j2                  f| j
                  | j                  | j                  | j                  d| j4                  }
t6        | q  ||
       yc c}	}}w )z See `window()` for more details.r   )dtyper
   r   r   r   )r   r   r   r   N)_input_datasetr   convert_to_tensorr   int64_size_shift_stridebool_drop_remainderr   pack_sequence_asr   get_legacy_output_classeszipflattenget_legacy_output_shapesget_legacy_output_typesDatasetSpecr   convert_legacy_structure
_structure_namer   window_dataset_variant_tensor_common_argssuper__init__)selfr   r   r   r   r   r
   output_classoutput_shapeoutput_typevariant_tensor	__class__s              r   r-   z_WindowDataset.__init__#   s    (D&&t6<<fMDJ''V\\PDK((fll3DL00fkk0@BD++--m<
 <?99-HJ88GI77FH<I		
 	
 8lK ##22;3?AB	
DO DJ$33%%ZZkk||++ 

N 
G]N3)	
s   5Hc                     | j                   S N)r'   )r.   s    r   element_specz_WindowDataset.element_specJ   s    ??r   r5   )__name__
__module____qualname____doc__r-   propertyr6   __classcell__)r3   s   @r   r   r       s%    G %4N  r   r   N)r:   tensorflow.python.data.opsr   tensorflow.python.data.utilr   r   tensorflow.python.frameworkr   r   tensorflow.python.opsr   r   UnaryDatasetr    r   r   <module>rC      s4    6 2 , 1 . + 1E,[-- ,r   