mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-11-01 00:28:11 +08:00 
			
		
		
		
	 6b0d30bb85
			
		
	
	6b0d30bb85
	
	
	
		
			
			* implemented vector_norm in cpp added linalg to mlx * implemented vector_norm python binding * renamed vector_norm to norm, implemented norm without provided ord * completed the implementation of the norm * added tests * removed unused import in linalg.cpp * updated python bindings * added some tests for python bindings * handling inf, -inf as numpy does, more extensive tests of compatibility with numpy * added better docs and examples * refactored mlx.linalg.norm bindings * reused existing util for implementation of linalg.norm * more tests * fixed a bug with no ord and axis provided * removed unused imports * some style and API consistency updates to linalg norm * remove unused includes * fix python tests * fixed a bug with frobenius norm of a complex-valued matrix * complex for vector too --------- Co-authored-by: Awni Hannun <awni@apple.com>
		
			
				
	
	
		
			40 lines
		
	
	
		
			793 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			793 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
| FetchContent_Declare(
 | |
|   doctest
 | |
|   GIT_REPOSITORY "https://github.com/onqtam/doctest"
 | |
|   GIT_TAG "b7c21ec5ceeadb4951b00396fc1e4642dd347e5f"
 | |
| )
 | |
| FetchContent_MakeAvailable(doctest)
 | |
| 
 | |
| add_executable(tests ${PROJECT_SOURCE_DIR}/tests/tests.cpp)
 | |
| 
 | |
| if (MLX_BUILD_METAL)
 | |
|   set(
 | |
|     METAL_TEST_SOURCES
 | |
|     metal_tests.cpp
 | |
|   )
 | |
| endif()
 | |
| 
 | |
| target_sources(tests PRIVATE 
 | |
|   allocator_tests.cpp
 | |
|   array_tests.cpp
 | |
|   arg_reduce_tests.cpp
 | |
|   autograd_tests.cpp
 | |
|   blas_tests.cpp
 | |
|   creations_tests.cpp
 | |
|   device_tests.cpp
 | |
|   eval_tests.cpp
 | |
|   fft_tests.cpp
 | |
|   graph_optimize_tests.cpp
 | |
|   load_tests.cpp
 | |
|   ops_tests.cpp
 | |
|   random_tests.cpp
 | |
|   scheduler_tests.cpp
 | |
|   utils_tests.cpp
 | |
|   vmap_tests.cpp
 | |
|   linalg_tests.cpp
 | |
|   ${METAL_TEST_SOURCES}
 | |
| )
 | |
| 
 | |
| target_link_libraries(tests PRIVATE mlx doctest)
 | |
| add_test(NAME tests COMMAND tests)
 |