Update Nd4jTestsC.java
parent
459502f2bd
commit
bcce1f8db4
|
@ -251,7 +251,7 @@ public class Nd4jTestsC extends BaseNd4jTestWithBackends {
|
||||||
@MethodSource("org.nd4j.linalg.BaseNd4jTestWithBackends#configs")
|
@MethodSource("org.nd4j.linalg.BaseNd4jTestWithBackends#configs")
|
||||||
public void testSerialization(Nd4jBackend backend) throws Exception {
|
public void testSerialization(Nd4jBackend backend) throws Exception {
|
||||||
Nd4j.getRandom().setSeed(12345);
|
Nd4j.getRandom().setSeed(12345);
|
||||||
INDArray arr = Nd4j.rand(1, 20);
|
INDArray arr = Nd4j.rand(1, 20).castTo(DataType.DOUBLE);
|
||||||
|
|
||||||
File dir = testDir.resolve("new-dir-" + UUID.randomUUID().toString()).toFile();
|
File dir = testDir.resolve("new-dir-" + UUID.randomUUID().toString()).toFile();
|
||||||
assertTrue(dir.mkdirs());
|
assertTrue(dir.mkdirs());
|
||||||
|
@ -2413,7 +2413,7 @@ public class Nd4jTestsC extends BaseNd4jTestWithBackends {
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
@MethodSource("org.nd4j.linalg.BaseNd4jTestWithBackends#configs")
|
@MethodSource("org.nd4j.linalg.BaseNd4jTestWithBackends#configs")
|
||||||
public void testPutAtIntervalIndexWithStride(Nd4jBackend backend) {
|
public void testPutAtIntervalIndexWithStride(Nd4jBackend backend) {
|
||||||
INDArray n1 = Nd4j.create(3, 3).assign(0.0.castTo(DataType.DOUBLE));
|
INDArray n1 = Nd4j.create(3, 3).assign(0.0).castTo(DataType.DOUBLE));
|
||||||
INDArrayIndex[] indices = {NDArrayIndex.interval(0, 2, 3), NDArrayIndex.all()};
|
INDArrayIndex[] indices = {NDArrayIndex.interval(0, 2, 3), NDArrayIndex.all()};
|
||||||
n1.put(indices, 1);
|
n1.put(indices, 1);
|
||||||
INDArray expected = Nd4j.create(new double[][] {{1d, 1d, 1d}, {0d, 0d, 0d}, {1d, 1d, 1d}});
|
INDArray expected = Nd4j.create(new double[][] {{1d, 1d, 1d}, {0d, 0d, 0d}, {1d, 1d, 1d}});
|
||||||
|
|
Loading…
Reference in New Issue