Skip to content

Commit 5a53b6d

Browse files
committed
fix reshape test to check for full arrays
1 parent aad7147 commit 5a53b6d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tools/test/src/tools/Reshape.scala

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,20 @@ object Reshape {
4343
val output =
4444
new DataInputStream(new ByteArrayInputStream(bytes))
4545

46+
val outputSize = arraySize * 4
47+
4648
val result = Util
47-
.readResult(dataType, output, arraySize, arraySize * 4)
48-
.grouped(arraySize)
49-
.map(_.take(2))
49+
.readResult(dataType, output, arraySize, outputSize)
50+
.toArray
51+
52+
val golden = Golden
53+
.grouped(2)
54+
.map(_ ++ Array.fill(arraySize - 2)(0f))
5055
.flatten
5156
.toArray
5257

53-
for (i <- 0 until 8)
54-
rmse.addSample(result(i), Golden(i))
58+
for (i <- 0 until outputSize)
59+
rmse.addSample(result(i), golden(i))
5560

5661
assert(rmse.compute < dataType.error)
5762
}

0 commit comments

Comments
 (0)