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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user