From aa44fd6850ae0f15be5719aec4b098b23ffc6dd8 Mon Sep 17 00:00:00 2001 From: raver119 Date: Mon, 25 Nov 2019 08:52:11 +0300 Subject: [PATCH] one more BitCast test Signed-off-by: raver119 --- .../java/org/nd4j/linalg/custom/CustomOpsTests.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nd4j/nd4j-backends/nd4j-tests/src/test/java/org/nd4j/linalg/custom/CustomOpsTests.java b/nd4j/nd4j-backends/nd4j-tests/src/test/java/org/nd4j/linalg/custom/CustomOpsTests.java index ca075c872..c01cf1942 100644 --- a/nd4j/nd4j-backends/nd4j-tests/src/test/java/org/nd4j/linalg/custom/CustomOpsTests.java +++ b/nd4j/nd4j-backends/nd4j-tests/src/test/java/org/nd4j/linalg/custom/CustomOpsTests.java @@ -1088,6 +1088,16 @@ public class CustomOpsTests extends BaseNd4jTest { assertArrayEquals(new long[]{1,10, 2}, lsd.get(0).getShape()); } + @Test + public void testBitCastShape_3(){ + val x = Nd4j.createFromArray(new int[]{1, 2, 3, 4, 5, 6, 7, 8}).reshape(1, 4, 2); + val e = Nd4j.createFromArray(new long[]{8589934593L, 17179869187L, 25769803781L, 34359738375L}).reshape(1, 4); + val z = Nd4j.exec(new BitCast(x, DataType.LONG.toInt()))[0]; + + assertEquals(e, z); + } + + @Test public void testMatch_1() { INDArray x = Nd4j.ones(DataType.FLOAT, 3,3);