From a54357b64c15ed9235a798a256fae7e08891269e Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Tue, 7 Jan 2025 22:27:02 +0000 Subject: [PATCH] fix torch delegation --- src/array_api_extra/_delegation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/array_api_extra/_delegation.py b/src/array_api_extra/_delegation.py index 8ecff02..b8b6423 100644 --- a/src/array_api_extra/_delegation.py +++ b/src/array_api_extra/_delegation.py @@ -117,7 +117,7 @@ def pad( pad_width = xp.asarray(pad_width) pad_width = xp.broadcast_to(pad_width, (x.ndim, 2)) pad_width = xp.flip(pad_width, axis=(0,)).flatten() - return xp.nn.functional.pad(x, (pad_width,), value=constant_values) + return xp.nn.functional.pad(x, tuple(pad_width), value=constant_values) if _delegate(xp, NUMPY, JAX, CUPY): return xp.pad(x, pad_width, mode, constant_values=constant_values)