mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-11-01 00:28:11 +08:00 
			
		
		
		
	Add mx.finfo and use it when making causal mask (#1726)
				
					
				
			* finfo * fixes * docs
This commit is contained in:
		| @@ -43,3 +43,15 @@ TEST_CASE("test normalize axis") { | ||||
|   CHECK_THROWS(normalize_axis_index(3, 3)); | ||||
|   CHECK_THROWS(normalize_axis_index(-4, 3)); | ||||
| } | ||||
|  | ||||
| TEST_CASE("test finfo") { | ||||
|   CHECK_EQ(finfo(float32).dtype, float32); | ||||
|   CHECK_EQ(finfo(complex64).dtype, float32); | ||||
|   CHECK_EQ(finfo(float16).dtype, float16); | ||||
|   CHECK_EQ(finfo(float32).min, std::numeric_limits<float>::lowest()); | ||||
|   CHECK_EQ(finfo(float32).max, std::numeric_limits<float>::max()); | ||||
|   CHECK_EQ(finfo(complex64).min, std::numeric_limits<float>::lowest()); | ||||
|   CHECK_EQ(finfo(complex64).max, std::numeric_limits<float>::max()); | ||||
|   CHECK_EQ(finfo(float16).min, -65504); | ||||
|   CHECK_EQ(finfo(float16).max, 65504); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Awni Hannun
					Awni Hannun