o
    wi                     @  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 ]3}
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   )axis)lenshapeRuntimeErrornpzerosastypedtypeintmathfloorceilrangemaxminsum)selfxalphabetabiassize
square_summincc1c2cbeginendy r'   V/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/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   numpyr   onnx.reference.op_runr   r   r'   r'   r'   r(   <module>   s
   