Fix doc issues in mlx.nn.init.he_normal and mlx.nn.hard_tanh (#2968)

Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
1ndig0
2026-01-05 23:23:41 +08:00
committed by GitHub
parent 8de9ceb7d6
commit 1df6c2a009
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -100,7 +100,7 @@ def identity(dtype: mx.Dtype = mx.float32) -> Callable[[mx.array], mx.array]:
r"""An initializer that returns an identity matrix.
Args:
dtype (Dtype, optional): The data type of the array. Defaults:
dtype (Dtype, optional): The data type of the array. Default:
``float32``.
Returns:
@@ -253,7 +253,7 @@ def he_normal(
<https://arxiv.org/abs/1502.01852>`_
Args:
dtype (Dtype, optional): The data type of the array. Defaults to mx.float32.
dtype (Dtype, optional): The data type of the array. Default: ``float32``.
Returns:
Callable[[array, str, float], array]: An initializer that returns an
+1 -1
View File
@@ -299,7 +299,7 @@ def hardswish(x):
def hard_tanh(x, min_val=-1.0, max_val=1.0):
r"""Applies the HardTanh function.
Applies :math:`\max(\min(x, \text{max\_val}), \text{min\_val})` element-wise.
Applies :math:`\max(\min(x, \mathrm{max\_val}), \mathrm{min\_val})` element-wise.
"""
return mx.minimum(mx.maximum(x, min_val), max_val)