From 986997152a69b41053b3c962949b605209529be7 Mon Sep 17 00:00:00 2001 From: Ayush Date: Sun, 5 Oct 2025 19:01:37 +0530 Subject: [PATCH 1/2] Fix misleading documentation for smart_resize backend_module parameter --- keras/src/utils/image_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/keras/src/utils/image_utils.py b/keras/src/utils/image_utils.py index ca8289c9f9b7..245e7508d59a 100644 --- a/keras/src/utils/image_utils.py +++ b/keras/src/utils/image_utils.py @@ -354,8 +354,11 @@ def smart_resize( `"lanczos3"`, `"lanczos5"`. Defaults to `"bilinear"`. data_format: `"channels_last"` or `"channels_first"`. - backend_module: Backend module to use (if different from the default - backend). + Backend module to use (if different from the default + backend). This parameter is for internal use and should typically + be left as None. When None, defaults to `keras.src.backend`. + Note: This does NOT allow switching between TensorFlow/JAX/PyTorch + backends - use `keras.config.set_backend()` for that purpose. Returns: Array with shape `(size[0], size[1], channels)`. From 7abb45d64d0523d55c01fd9c28970905948c77c6 Mon Sep 17 00:00:00 2001 From: Ayush Date: Sun, 5 Oct 2025 19:07:45 +0530 Subject: [PATCH 2/2] Update keras/src/utils/image_utils.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- keras/src/utils/image_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras/src/utils/image_utils.py b/keras/src/utils/image_utils.py index 245e7508d59a..ac5f60aedfa8 100644 --- a/keras/src/utils/image_utils.py +++ b/keras/src/utils/image_utils.py @@ -354,7 +354,7 @@ def smart_resize( `"lanczos3"`, `"lanczos5"`. Defaults to `"bilinear"`. data_format: `"channels_last"` or `"channels_first"`. - Backend module to use (if different from the default + backend_module: Backend module to use (if different from the default backend). This parameter is for internal use and should typically be left as None. When None, defaults to `keras.src.backend`. Note: This does NOT allow switching between TensorFlow/JAX/PyTorch