diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index 85214a4356..0efa435bc7 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -6,6 +6,14 @@ 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#) 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);