
    6bi                         S r SSKJs  Jr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  \" S5       " S	 S
\5      5       rg)z&Keras zero-padding layer for 1D input.    N)backend)Layer)	InputSpec)
conv_utils)keras_exportzkeras.layers.ZeroPadding1Dc                   H   ^  \ rS rSrSrSU 4S jjrS rS rU 4S jrSr	U =r
$ )	ZeroPadding1D   a  Zero-padding layer for 1D input (e.g. temporal sequence).

Examples:

>>> input_shape = (2, 2, 3)
>>> x = np.arange(np.prod(input_shape)).reshape(input_shape)
>>> print(x)
[[[ 0  1  2]
  [ 3  4  5]]
 [[ 6  7  8]
  [ 9 10 11]]]
>>> y = tf.keras.layers.ZeroPadding1D(padding=2)(x)
>>> print(y)
tf.Tensor(
  [[[ 0  0  0]
    [ 0  0  0]
    [ 0  1  2]
    [ 3  4  5]
    [ 0  0  0]
    [ 0  0  0]]
   [[ 0  0  0]
    [ 0  0  0]
    [ 6  7  8]
    [ 9 10 11]
    [ 0  0  0]
    [ 0  0  0]]], shape=(2, 6, 3), dtype=int64)

Args:
    padding: Int, or tuple of int (length 2).
        - If int:
        How many zeros to add at the beginning and end of
        the padding dimension (axis 1).
        - If tuple of int (length 2):
        How many zeros to add at the beginning and the end of
        the padding dimension (`(left_pad, right_pad)`).

Input shape:
    3D tensor with shape `(batch_size, axis_to_pad, features)`

Output shape:
    3D tensor with shape `(batch_size, padded_axis, features)`
c                 z   > [         TU ]  " S0 UD6  [        R                  " USSSS9U l        [        SS9U l        g )N   paddingT)
allow_zero   )ndim )super__init__r   normalize_tupler   r   
input_spec)selfr   kwargs	__class__s      f/home/james-whalen/.local/lib/python3.13/site-packages/tf_keras/src/layers/reshaping/zero_padding1d.pyr   ZeroPadding1D.__init__J   s<    "6"!11Q	d
 $+    c                     US   b&  US   U R                   S   -   U R                   S   -   nOS n[        R                  " US   X!S   /5      $ )N   r   r   )r   tfTensorShape)r   input_shapelengths      r   compute_output_shape"ZeroPadding1D.compute_output_shapeQ   sP    q>% ^dll1o5QGFF~~{1~v1~FGGr   c                 >    [         R                  " XR                  S9$ )N)r   )r   temporal_paddingr   )r   inputss     r   callZeroPadding1D.callX   s    ''EEr   c                    > SU R                   0n[        TU ]	  5       n[        [	        UR                  5       5      [	        UR                  5       5      -   5      $ )Nr   )r   r   
get_configdictlistitems)r   configbase_configr   s      r   r*   ZeroPadding1D.get_config[   sG    T\\*g(*D**,-V\\^0DDEEr   )r   r   )r   )__name__
__module____qualname____firstlineno____doc__r   r"   r'   r*   __static_attributes____classcell__)r   s   @r   r	   r	      s&    )V,HFF Fr   r	   )r5   tensorflow.compat.v2compatv2r   tf_keras.srcr   tf_keras.src.engine.base_layerr   tf_keras.src.engine.input_specr   tf_keras.src.utilsr    tensorflow.python.util.tf_exportr   r	   r   r   r   <module>r@      sJ    - " !   0 4 ) : *+@FE @F ,@Fr   