Skip to content

Commit 1df6c2a

Browse files
Redempt1onzzZZawni
andauthored
Fix doc issues in mlx.nn.init.he_normal and mlx.nn.hard_tanh (#2968)
Co-authored-by: Awni Hannun <awni@apple.com>
1 parent 8de9ceb commit 1df6c2a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/mlx/nn/init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def identity(dtype: mx.Dtype = mx.float32) -> Callable[[mx.array], mx.array]:
100100
r"""An initializer that returns an identity matrix.
101101
102102
Args:
103-
dtype (Dtype, optional): The data type of the array. Defaults:
103+
dtype (Dtype, optional): The data type of the array. Default:
104104
``float32``.
105105
106106
Returns:
@@ -253,7 +253,7 @@ def he_normal(
253253
<https://arxiv.org/abs/1502.01852>`_
254254
255255
Args:
256-
dtype (Dtype, optional): The data type of the array. Defaults to mx.float32.
256+
dtype (Dtype, optional): The data type of the array. Default: ``float32``.
257257
258258
Returns:
259259
Callable[[array, str, float], array]: An initializer that returns an

python/mlx/nn/layers/activations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def hardswish(x):
299299
def hard_tanh(x, min_val=-1.0, max_val=1.0):
300300
r"""Applies the HardTanh function.
301301
302-
Applies :math:`\max(\min(x, \text{max\_val}), \text{min\_val})` element-wise.
302+
Applies :math:`\max(\min(x, \mathrm{max\_val}), \mathrm{min\_val})` element-wise.
303303
"""
304304
return mx.minimum(mx.maximum(x, min_val), max_val)
305305

0 commit comments

Comments
 (0)