Beispiel #1
0
def _neg(self):
    return flow.neg(self)
Beispiel #2
0
 def __neg__(self):
     return flow.neg(self)
Beispiel #3
0
 def test_negative_neg(test_case):
     input = flow.Tensor(np.array([1.0, -1.0, 2.3]).astype(np.float32),
                         dtype=flow.float32)
     of_out = flow.neg(input)
     np_out = -(input.numpy())
     test_case.assertTrue(np.array_equal(of_out.numpy(), np_out))