o
    i3                     @   s   d dl mZmZmZmZ ddlmZ ddlmZm	Z	m
Z
 eeeee f Zeeeedf f ZededZded	eeef fd
dZded	ee	e	f fddZded	ee
e
f fddZdd ZdS )    )SequenceTupleTypeVarUnion   )Model)ArrayXdFloatsXdIntsXd.ArrayTXd)boundindexreturnc                 C      t dtd| idS )a5  Index into input arrays, and return the subarrays.

    index:
        A valid numpy-style index. Multi-dimensional indexing can be performed
        by passing in a tuple, and slicing can be performed using the slice object.
        For instance, X[:, :-1] would be (slice(None, None), slice(None, -1)).
    zarray-getitemr   attrsr   forwardr    r   N/home/ubuntu/.local/lib/python3.10/site-packages/thinc/layers/array_getitem.pyarray_getitem   s   r   c                 C   r   )}Index into input arrays, and return the subarrays.

    This delegates to `array_getitem`, but allows type declarations.
    zfloats-getitemr   r   r   r   r   r   r   floats_getitem      r   c                 C   r   )r   zints-getitemr   r   r   r   r   r   r   ints_getitem   r   r   c                    sL   j d |j|j  fdd}t|dkr||fS | }||fS )Nr   c                    s   j j d}| |< |S )N)dtype)opsalloc)dYdXr   r   modelshaper   r   backprop_get_column+   s   z$forward.<locals>.backprop_get_columnr   )r   r#   r   len)r"   Xis_trainr$   Yr   r!   r   r   &   s   
r   N)typingr   r   r   r   r"   r   typesr   r	   r
   intslice	AxisIndexIndexr   r   r   r   r   r   r   r   r   <module>   s    