Skip to content

Commit

Permalink
Add integration test for truncated-normal op
Browse files Browse the repository at this point in the history
  • Loading branch information
AzizZayed committed Jun 18, 2021
1 parent 4119d0d commit 1011ad0
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,16 @@ public void testRandomNormal() {
}
}

@Test
public void testTruncatedNormal() {
try (NDManager manager = NDManager.newBaseManager()) {
NDArray normal = manager.truncatedNormal(new Shape(1000, 1000));
Assertions.assertAlmostEquals(normal.mean().getFloat(), 0f, 2e-2f, 2e-2f);
Assert.assertTrue(normal.gte(-2).all().getBoolean());
Assert.assertTrue(normal.lte(2).all().getBoolean());
}
}

@Test
public void testFixedSeed() {
try (NDManager manager = NDManager.newBaseManager()) {
Expand Down

0 comments on commit 1011ad0

Please sign in to comment.