a
    Sic
                     @   sb   d Z ddlm  mZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ edG dd	 d	eZdS )
z%Keras upsampling layer for 1D inputs.    N)backend)Layer)	InputSpec)keras_exportzkeras.layers.UpSampling1Dc                       s>   e Zd ZdZd fdd	Zdd Zdd Z fd	d
Z  ZS )UpSampling1Da  Upsampling layer for 1D inputs.

    Repeats each temporal step `size` times along the time axis.

    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.UpSampling1D(size=2)(x)
    >>> print(y)
    tf.Tensor(
      [[[ 0  1  2]
        [ 0  1  2]
        [ 3  4  5]
        [ 3  4  5]]
       [[ 6  7  8]
        [ 6  7  8]
        [ 9 10 11]
        [ 9 10 11]]], shape=(2, 4, 3), dtype=int64)

    Args:
      size: Integer. Upsampling factor.

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

    Output shape:
      3D tensor with shape: `(batch_size, upsampled_steps, features)`.
       c                    s,   t  jf i | t|| _tdd| _d S )N   )ndim)super__init__intsizer   
input_spec)selfr   kwargs	__class__ `/var/www/html/django/DPS/env/lib/python3.9/site-packages/keras/layers/reshaping/up_sampling1d.pyr   A   s    
zUpSampling1D.__init__c                 C   sD   t | }|d d ur(| j|d  nd }t |d ||d gS )N   r   r   )tfTensorShapeas_listr   )r   input_shaper   r   r   r   compute_output_shapeF   s    z!UpSampling1D.compute_output_shapec                 C   s   t j|| jdd}|S )Nr   )axis)r   repeat_elementsr   )r   inputsoutputr   r   r   callM   s    zUpSampling1D.callc                    s0   d| j i}t  }tt| t|  S )Nr   )r   r
   
get_configdictlistitems)r   configbase_configr   r   r   r    Q   s    

zUpSampling1D.get_config)r   )	__name__
__module____qualname____doc__r   r   r   r    __classcell__r   r   r   r   r      s
   #r   )r)   tensorflow.compat.v2compatv2r   kerasr   keras.engine.base_layerr   keras.engine.input_specr    tensorflow.python.util.tf_exportr   r   r   r   r   r   <module>   s   