From ba6568334e4dadaba7a752e6727f5d1d066ccc47 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Tue, 16 Sep 2025 21:10:36 -0400 Subject: [PATCH 1/3] Update Changelog --- com.unity.ml-agents/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index 85214a4356..da7b415ce6 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Minor Changes +#### com.unity.ml-agents (C#) +- Fixed tensor indexing to use correct CHW layout (#6239) +#### ml-agents / ml-agents-envs +- Fixed CUDA/CPU mismatch in threaded training (#6245) + ## [4.0.0] - 2025-08-15 ### Major Changes #### com.unity.ml-agents (C#) From 90baefcf7100bc4548c43420b1551da3a05f46c2 Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Tue, 16 Sep 2025 21:14:38 -0400 Subject: [PATCH 2/3] Add space --- com.unity.ml-agents/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index da7b415ce6..0efa435bc7 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to ### Minor Changes #### com.unity.ml-agents (C#) - Fixed tensor indexing to use correct CHW layout (#6239) + #### ml-agents / ml-agents-envs - Fixed CUDA/CPU mismatch in threaded training (#6245) From dac39a7972432ad197fa2f5ea34a28d5fbddebdd Mon Sep 17 00:00:00 2001 From: maryam-zia Date: Tue, 16 Sep 2025 22:32:33 -0400 Subject: [PATCH 3/3] Update tests --- .../Integrations/Match3/Match3SensorTests.cs | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3SensorTests.cs b/com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3SensorTests.cs index 09d882427a..1d109bd367 100644 --- a/com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3SensorTests.cs +++ b/com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3SensorTests.cs @@ -146,9 +146,8 @@ public void TestVisualObservations(bool fullBoard) { expectedObs = new float[] { - 1, 0, /**/ 0, 1, /**/ 1, 0, - 1, 0, /**/ 1, 0, /**/ 1, 0, - 1, 0, /**/ 1, 0, /**/ 1, 0, + // NCHW layout: [channel0_all_positions, channel1_all_positions] + 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0 }; expectedObs3D = new float[,,] @@ -158,9 +157,8 @@ public void TestVisualObservations(bool fullBoard) { expectedObs = new float[] { - 1, 0, /* 0 */ 0, 1, /* 1 */ 0, 0, /* empty */ - 1, 0, /* 0 */ 1, 0, /* 0 */ 0, 0, /* empty */ - 0, 0, /* empty */ 0, 0, /* empty */ 0, 0, /* empty */ + // NCHW layout: [channel0_all_positions, channel1_all_positions] + 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }; expectedObs3D = new float[,,] @@ -201,9 +199,8 @@ public void TestVisualObservationsSpecial() var expectedObs = new float[] { - 1, 0, /* (0) */ 0, 1, /* (1) */ 1, 0, /* (0) */ - 1, 0, /* (0) */ 1, 0, /* (0) */ 1, 0, /* (0) */ - 1, 0, /* (0) */ 1, 0, /* (0) */ 1, 0, /* (0) */ + // NCHW layout: [channel0_all_positions, channel1_all_positions] + 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0 }; SensorTestHelper.CompareObservation(cellSensor, expectedObs); @@ -238,9 +235,8 @@ public void TestVisualObservationsSpecial() var expectedObs = new float[] { - 1, 0, 0, /* (0) */ 1, 0, 0, /* (1) */ 1, 0, 0, /* (0) */ - 0, 0, 1, /* (2) */ 1, 0, 0, /* (0) */ 1, 0, 0, /* (0) */ - 1, 0, 0, /* (0) */ 0, 1, 0, /* (1) */ 1, 0, 0, /* (0) */ + // NCHW layout: [channel0_all_positions, channel1_all_positions, channel2_all_positions] + 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }; SensorTestHelper.CompareObservation(specialSensor, expectedObs);