mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-11-04 10:38:10 +08:00 
			
		
		
		
	Fix a few issues: docs for flatten, erf, dequantize validation (#560)
* doc flatten * erf doc * check values for dequantize * format
This commit is contained in:
		@@ -78,6 +78,11 @@ void init_ops(py::module_& m) {
 | 
			
		||||
 | 
			
		||||
      Flatten an array.
 | 
			
		||||
 | 
			
		||||
      The axes flattened will be between ``start_axis`` and ``end_axis``,
 | 
			
		||||
      inclusive. Negative axes are supported. After converting negative axis to
 | 
			
		||||
      positive, axes outside the valid range will be clamped to a valid value,
 | 
			
		||||
      ``start_axis`` to ``0`` and ``end_axis`` to ``ndim - 1``.
 | 
			
		||||
 | 
			
		||||
      Args:
 | 
			
		||||
          a (array): Input array.
 | 
			
		||||
          start_axis (int, optional): The first dimension to flatten. Defaults to ``0``.
 | 
			
		||||
@@ -87,6 +92,14 @@ void init_ops(py::module_& m) {
 | 
			
		||||
 | 
			
		||||
      Returns:
 | 
			
		||||
          array: The flattened array.
 | 
			
		||||
 | 
			
		||||
      Example:
 | 
			
		||||
          >>> a = mx.array([[1, 2], [3, 4]])
 | 
			
		||||
          >>> mx.flatten(a)
 | 
			
		||||
          array([1, 2, 3, 4], dtype=int32)
 | 
			
		||||
          >>>
 | 
			
		||||
          >>> mx.flatten(a, start_axis=0, end_axis=-1)
 | 
			
		||||
          array([1, 2, 3, 4], dtype=int32)
 | 
			
		||||
  )pbdoc");
 | 
			
		||||
  m.def(
 | 
			
		||||
      "squeeze",
 | 
			
		||||
@@ -801,7 +814,7 @@ void init_ops(py::module_& m) {
 | 
			
		||||
        Element-wise error function.
 | 
			
		||||
 | 
			
		||||
        .. math::
 | 
			
		||||
          \mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^t e^{-t^2} \, dx
 | 
			
		||||
          \mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} \, dt
 | 
			
		||||
 | 
			
		||||
        Args:
 | 
			
		||||
            a (array): Input array.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user