def _neg(self): return flow.neg(self)
def __neg__(self): return flow.neg(self)
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))