(self)
| 314 | np.testing.assert_array_equal(Tensor.randint(16, low=5, high=6).numpy(), 5) |
| 315 | |
| 316 | def test_normal(self): |
| 317 | self.assertTrue(normal_test(Tensor.normal)) |
| 318 | self.assertTrue(equal_distribution(Tensor.normal, lambda x: torch.nn.init.normal_(torch.empty(x), mean=0, std=1), |
| 319 | lambda x: np.random.normal(loc=0, scale=1, size=x))) |
| 320 | # check std >= 0 |
| 321 | with self.assertRaises(ValueError): Tensor.normal((3, 4), mean=0, std=-1) |
| 322 | |
| 323 | def test_uniform(self): |
| 324 | self.assertFalse(normal_test(Tensor.uniform)) |
nothing calls this directly
no test coverage detected