Skip to content

Commit d1147c1

Browse files
authored
Update Changelog and test (#6246)
* Update Changelog * Update tests
1 parent db4c207 commit d1147c1

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

com.unity.ml-agents/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to
77
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

9+
## [Unreleased]
10+
### Minor Changes
11+
#### com.unity.ml-agents (C#)
12+
- Fixed tensor indexing to use correct CHW layout (#6239)
13+
14+
#### ml-agents / ml-agents-envs
15+
- Fixed CUDA/CPU mismatch in threaded training (#6245)
16+
917
## [4.0.0] - 2025-08-15
1018
### Major Changes
1119
#### com.unity.ml-agents (C#)

com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3SensorTests.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,8 @@ public void TestVisualObservations(bool fullBoard)
146146
{
147147
expectedObs = new float[]
148148
{
149-
1, 0, /**/ 0, 1, /**/ 1, 0,
150-
1, 0, /**/ 1, 0, /**/ 1, 0,
151-
1, 0, /**/ 1, 0, /**/ 1, 0,
149+
// NCHW layout: [channel0_all_positions, channel1_all_positions]
150+
1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0
152151
};
153152

154153
expectedObs3D = new float[,,]
@@ -158,9 +157,8 @@ public void TestVisualObservations(bool fullBoard)
158157
{
159158
expectedObs = new float[]
160159
{
161-
1, 0, /* 0 */ 0, 1, /* 1 */ 0, 0, /* empty */
162-
1, 0, /* 0 */ 1, 0, /* 0 */ 0, 0, /* empty */
163-
0, 0, /* empty */ 0, 0, /* empty */ 0, 0, /* empty */
160+
// NCHW layout: [channel0_all_positions, channel1_all_positions]
161+
1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
164162
};
165163

166164
expectedObs3D = new float[,,]
@@ -201,9 +199,8 @@ public void TestVisualObservationsSpecial()
201199

202200
var expectedObs = new float[]
203201
{
204-
1, 0, /* (0) */ 0, 1, /* (1) */ 1, 0, /* (0) */
205-
1, 0, /* (0) */ 1, 0, /* (0) */ 1, 0, /* (0) */
206-
1, 0, /* (0) */ 1, 0, /* (0) */ 1, 0, /* (0) */
202+
// NCHW layout: [channel0_all_positions, channel1_all_positions]
203+
1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0
207204
};
208205
SensorTestHelper.CompareObservation(cellSensor, expectedObs);
209206

@@ -238,9 +235,8 @@ public void TestVisualObservationsSpecial()
238235

239236
var expectedObs = new float[]
240237
{
241-
1, 0, 0, /* (0) */ 1, 0, 0, /* (1) */ 1, 0, 0, /* (0) */
242-
0, 0, 1, /* (2) */ 1, 0, 0, /* (0) */ 1, 0, 0, /* (0) */
243-
1, 0, 0, /* (0) */ 0, 1, 0, /* (1) */ 1, 0, 0, /* (0) */
238+
// NCHW layout: [channel0_all_positions, channel1_all_positions, channel2_all_positions]
239+
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
244240
};
245241
SensorTestHelper.CompareObservation(specialSensor, expectedObs);
246242

0 commit comments

Comments
 (0)