mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-10-31 16:21:27 +08:00 
			
		
		
		
	make python array SupportsAbs conform (like numpy) (#624)
This commit is contained in:
		| @@ -696,6 +696,8 @@ class TestOps(mlx_tests.MLXTestCase): | ||||
|         expected = np.abs(a, dtype=np.float32) | ||||
|         self.assertTrue(np.allclose(result, expected)) | ||||
|  | ||||
|         self.assertTrue(np.allclose(a.abs(), abs(a))) | ||||
|  | ||||
|     def test_negative(self): | ||||
|         a = mx.array([-1.0, 1.0, -2.0, 3.0]) | ||||
|         result = mx.negative(a) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Daniel Strobusch
					Daniel Strobusch