U
    qh                     @  s<   d dl mZ d dlZd dlZd dlmZ G dd deZdS )    )annotationsN)OpRunc                   @  s   e Zd ZdddZdS )LRNNc                 C  s
  t |jdkr td|jdt|j|j}|jd }tt	|d d }tt
|d d d }	t|jd D ]f}
td|
| }t||
|	 }tj|d d ||d d d d f d dd|d d |
d d d d f< q||||| |  |  }||jfS )N   z,LRN only applies on 4D tensors but shape is .      r   )Zaxis)lenshapeRuntimeErrornpzerosZastypeZdtypeintmathfloorceilrangemaxminsum)selfxalphabetaZbiassizeZ
square_sumZmincZc1c2cbeginendy r    =/tmp/pip-unpacked-wheel-xnis5xre/onnx/reference/ops/op_lrn.py_run   s    
HzLRN._run)NNNN)__name__
__module____qualname__r"   r    r    r    r!   r      s   r   )
__future__r   r   Znumpyr   Zonnx.reference.op_runr   r   r    r    r    r!   <module>   s   