Check if kernel size is within U55 constraints. Checks that ``kernel_x * kernel_y`` is in ``[1, 65536]`` and ``kernel_y`` is in ``[1, 256]`` as required by the U55 profile. Args: kernel (tuple[int, int]): Kernel height and width ``(kh, kw)``. Returns: bool: True if
(kernel: tuple[int, int])
| 26 | |
| 27 | |
| 28 | def kernel_check(kernel: tuple[int, int]) -> bool: |
| 29 | """Check if kernel size is within U55 constraints. |
| 30 | |
| 31 | Checks that ``kernel_x * kernel_y`` is in ``[1, 65536]`` and |
| 32 | ``kernel_y`` is in ``[1, 256]`` as required by the U55 profile. |
| 33 | |
| 34 | Args: |
| 35 | kernel (tuple[int, int]): Kernel height and width ``(kh, kw)``. |
| 36 | |
| 37 | Returns: |
| 38 | bool: True if the kernel passes validation. |
| 39 | |
| 40 | """ |
| 41 | if not (1 <= kernel[0] * kernel[1] <= 65536): |
| 42 | return False |
| 43 | return 1 <= kernel[1] <= 256 |
| 44 | |
| 45 | |
| 46 | def stride_check(strides: tuple[int, int]) -> bool: |
no outgoing calls
no test coverage detected