From 424f5cc89a5f30083134826ff869f570f0f0db2c Mon Sep 17 00:00:00 2001 From: Viviane Rochon Montplaisir Date: Tue, 14 Jul 2026 12:37:44 -0400 Subject: [PATCH] Tighten bound for test_process_pixel_gray. Rebase changes from PR #5690 on develop branch Co-authored-by: austereantelope <95935342+austereantelope@users.noreply.github.com> --- com.unity.ml-agents/CHANGELOG.md | 1 + ml-agents-envs/tests/test_rpc_utils.py | 2 +- ml-agents/mlagents/trainers/tests/test_rpc_utils.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index 0237b6c34ed..3ad6d47a1ce 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to - Fixed a bug when using LSTM and SAC where the buffer might contain non-integer numbers of sequences. (#6301) - Fixed mixed CPU/GPU computation by ensuring tensors share a consistent device in the trainer; Updated training devices. (#6303) - Fix typing on optional strings (#6311) +- Tighten assertion bound for test_process_pixels_gray (#6312) #### Examples - Replace hardcoded value 200f by agentRotationSpeed in MoveAgent() (#6306) diff --git a/ml-agents-envs/tests/test_rpc_utils.py b/ml-agents-envs/tests/test_rpc_utils.py index 8440d6586a8..85b75d54507 100644 --- a/ml-agents-envs/tests/test_rpc_utils.py +++ b/ml-agents-envs/tests/test_rpc_utils.py @@ -259,7 +259,7 @@ def test_process_pixels_gray(): byte_arr = generate_compressed_data(in_array) out_array = process_pixels(byte_arr, 1) assert out_array.shape == (1, 128, 64) - assert np.mean(in_array.mean(axis=0, keepdims=True) - out_array) < 0.01 + assert np.mean(in_array.mean(axis=0, keepdims=True) - out_array) < 0.002 assert np.allclose(in_array.mean(axis=0, keepdims=True), out_array, atol=0.01) diff --git a/ml-agents/mlagents/trainers/tests/test_rpc_utils.py b/ml-agents/mlagents/trainers/tests/test_rpc_utils.py index 6599c8948dd..574da87714a 100644 --- a/ml-agents/mlagents/trainers/tests/test_rpc_utils.py +++ b/ml-agents/mlagents/trainers/tests/test_rpc_utils.py @@ -259,7 +259,7 @@ def test_process_pixels_gray(): byte_arr = generate_compressed_data(in_array) out_array = process_pixels(byte_arr, 1) assert out_array.shape == (1, 128, 64) - assert np.mean(in_array.mean(axis=0, keepdims=True) - out_array) < 0.01 + assert np.mean(in_array.mean(axis=0, keepdims=True) - out_array) < 0.002 assert np.allclose(in_array.mean(axis=0, keepdims=True), out_array, atol=0.01)