예제 #1
0
 def test_axis(self):
     t = TensorBase(
         np.array([[0.77937768, 0.51022484, 0.49155195, 0.02769902],
                   [0.03777148, 0.13020167, 0.02155692, 0.69574893]]))
     result = t.max(axis=1)
     self.assertTrue(syft.equal(result, [0.77937768, 0.69574893]))
     result = t.max(axis=0)
     self.assertTrue(
         syft.equal(result,
                    [0.77937768, 0.51022484, 0.49155195, 0.69574893]))
예제 #2
0
 def testNoDim(self):
     t = TensorBase(np.array([[0.77937768, 0.51022484, 0.49155195, 0.02769902], [0.03777148, 0.13020167, 0.02155692, 0.69574893]]))
     self.assertTrue(t.max() == 0.77937768)