def test_rand(self): np.random.seed(0) x = syft.rand(5).data np.random.seed(0) y = np.random.rand(5) self.assertTrue((x == y).all())
def rand(self, dim): """Returns an encrypted tensor with initial numbers sampled from a uniform distribution from 0 to 1.""" return syft.rand(dim).encrypt(self)