コード例 #1
0
 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())
コード例 #2
0
 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)