1
0
Fork 0

fix(api): keep kernel slices within bounds

This commit is contained in:
Sean Sube 2023-06-16 20:49:43 -05:00
parent c1a4484b75
commit 5713957026
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 2 additions and 2 deletions

View File

@ -79,8 +79,8 @@ def fix_node_name(key: str):
def kernel_slice(x: int, y: int, shape: Tuple[int, int, int, int]) -> Tuple[int, int]:
return (
max(x, shape[2]),
max(y, shape[3]),
min(x, shape[2] - 1),
min(y, shape[3] - 1),
)