Nd4j refactoring (#112)
* refactoring Signed-off-by: Robert Altena <Rob@Ra-ai.com> * wip Signed-off-by: Robert Altena <Rob@Ra-ai.com> * wip Signed-off-by: Robert Altena <Rob@Ra-ai.com> * wip * fix: make test public. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * make test public. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * fixes read refactoring. Signed-off-by: Robert Altena <Rob@Ra-ai.com>master
parent
c7277729e9
commit
59cba587f4
File diff suppressed because it is too large
Load Diff
|
@ -7979,6 +7979,14 @@ public class Nd4jTestsC extends BaseNd4jTest {
|
||||||
//from [4,4,3] to [2,4,6] then crop to [2,4,5]
|
//from [4,4,3] to [2,4,6] then crop to [2,4,5]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testToFromByteArray() throws IOException {
|
||||||
|
// simple test to get rid of toByteArray and fromByteArray compiler warnings.
|
||||||
|
INDArray x = Nd4j.arange(10);
|
||||||
|
byte[] xb = Nd4j.toByteArray(x);
|
||||||
|
INDArray y = Nd4j.fromByteArray(xb);
|
||||||
|
assertEquals(x,y);
|
||||||
|
}
|
||||||
|
|
||||||
private static INDArray fwd(INDArray input, INDArray W, INDArray b){
|
private static INDArray fwd(INDArray input, INDArray W, INDArray b){
|
||||||
INDArray ret = Nd4j.createUninitialized(input.size(0), W.size(1));
|
INDArray ret = Nd4j.createUninitialized(input.size(0), W.size(1));
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class RngTests extends BaseNd4jTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testRandomBinomial() {
|
public void testRandomBinomial() {
|
||||||
//silly tests. Just increasing the usage for randomBinomial to stop compiler warnings.
|
//silly tests. Just increasing the usage for randomBinomial to stop compiler warnings.
|
||||||
INDArray x = Nd4j.randomBinomial(10, 0.5, 3,3);
|
INDArray x = Nd4j.randomBinomial(10, 0.5, 3,3);
|
||||||
assertTrue(x.sum().getDouble(0) > 0.0); //silly test. Just increasing th usage for randomBinomial
|
assertTrue(x.sum().getDouble(0) > 0.0); //silly test. Just increasing th usage for randomBinomial
|
||||||
|
|
Loading…
Reference in New Issue