Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb4c207

Browse files
authored
Fix visual observation tensor indexing for Unity inference. (#6239)
This change corrects the tensor indexing calculation in TensorExtensions.Index()to properly support CHW (channels-height-width) format used by both Unity'sobservation writers and ONNX models during inference.
1 parenta83b3b8 commitdb4c207

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎com.unity.ml-agents/Runtime/Inference/TensorExtensions.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ public static int Index(this TensorShape shape, int n, int c, int h, int w)
5757
{
5858
intindex=
5959
n*shape.Height()*shape.Width()*shape.Channels()+
60-
h*shape.Width()*shape.Channels()+
61-
w*shape.Channels()+
62-
c;
60+
c*shape.Height()*shape.Width()+
61+
h*shape.Width()+
62+
w;
6363
returnindex;
6464
}
6565
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp