mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-10-31 16:21:27 +08:00 
			
		
		
		
	| @@ -803,9 +803,10 @@ auto mlx_slice_update( | ||||
|   // Pre process tuple | ||||
|   auto upd = to_array(v, src.dtype()); | ||||
|  | ||||
|   // Remove leading singletons dimensions from the update | ||||
|   // Remove extra leading singletons dimensions from the update | ||||
|   int s = 0; | ||||
|   for (; s < upd.ndim() && upd.shape(s) == 1; s++) { | ||||
|   for (; s < upd.ndim() && upd.shape(s) == 1 && (upd.ndim() - s) > src.ndim(); | ||||
|        s++) { | ||||
|   }; | ||||
|   auto up_shape = std::vector<int>(upd.shape().begin() + s, upd.shape().end()); | ||||
|   up_shape = up_shape.empty() ? std::vector{1} : up_shape; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Awni Hannun
					Awni Hannun