Skip to content

Commit fd75d6c

Browse files
Copilotkirklandsign
andcommitted
Fix double-increment bug in getInts() and getFloats() methods in ETImage.java
Co-authored-by: kirklandsign <107070759+kirklandsign@users.noreply.github.com>
1 parent 7b9e0a1 commit fd75d6c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • llm/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo

llm/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/ETImage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ public int[] getInts() {
5151
// the runner expects an int array as input.
5252
int[] intArray = new int[bytes.length];
5353
for (int i = 0; i < bytes.length; i++) {
54-
intArray[i] = (bytes[i++] & 0xFF);
54+
intArray[i] = (bytes[i] & 0xFF);
5555
}
5656
return intArray;
5757
}
5858

5959
public float[] getFloats() {
6060
float[] floatArray = new float[bytes.length];
6161
for (int i = 0; i < bytes.length; i++) {
62-
floatArray[i] = (((bytes[i++] & 0xFF) / 255.0f) - 0.5f) / 0.5f;
62+
floatArray[i] = (((bytes[i] & 0xFF) / 255.0f) - 0.5f) / 0.5f;
6363
}
6464
return floatArray;
6565
}

0 commit comments

Comments
 (0)