Skip to content

Commit 391e140

Browse files
authored
chore: Fix unresolved mx.array docstring (#3990)
1 parent f99e1dc commit 391e140

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

python/mlx/nn/layers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def load_weights(
129129
Update the model's weights from a ``.npz``, a ``.safetensors`` file, or a list.
130130
131131
Args:
132-
file_or_weights (str or list(tuple(str, mx.array))): The path to
132+
file_or_weights (str or list(tuple(str, array))): The path to
133133
the weights ``.npz`` file (``.npz`` or ``.safetensors``) or a list
134134
of pairs of parameter names and arrays.
135135
strict (bool, optional): If ``True`` then checks that the provided

python/mlx/nn/losses.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,16 +540,16 @@ def cosine_similarity_loss(
540540
\frac{x_1 \cdot x_2}{\max(\|x_1\| \cdot \|x_2\|, \epsilon)}
541541
542542
Args:
543-
x1 (mx.array): The first set of inputs.
544-
x2 (mx.array): The second set of inputs.
543+
x1 (array): The first set of inputs.
544+
x2 (array): The second set of inputs.
545545
axis (int, optional): The embedding axis. Default: ``1``.
546546
eps (float, optional): The minimum value of the denominator used for
547547
numerical stability. Default: ``1e-8``.
548548
reduction (str, optional): Specifies the reduction to apply to the output:
549549
``'none'`` | ``'mean'`` | ``'sum'``. Default: ``'none'``.
550550
551551
Returns:
552-
mx.array: The computed cosine similarity loss.
552+
array: The computed cosine similarity loss.
553553
"""
554554
x1_norm = mx.linalg.norm(x1, axis=axis)
555555
x2_norm = mx.linalg.norm(x2, axis=axis)

python/mlx/optimizers/optimizers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def init_single(self, parameter: mx.array, state: dict):
7777
state initialization.
7878
7979
Args:
80-
parameter (mx.array): A single parameter that will be optimized.
80+
parameter (array): A single parameter that will be optimized.
8181
state (dict): The optimizer's state.
8282
"""
8383
raise NotImplementedError()
@@ -112,8 +112,8 @@ def apply_single(self, gradient: mx.array, parameter: mx.array, state: dict):
112112
"""To be extended by derived classes to implement the optimizer's update.
113113
114114
Args:
115-
gradient (mx.array): The ``parameter`` gradient.
116-
parameter (mx.array): The ``parameter`` to update.
115+
gradient (array): The ``parameter`` gradient.
116+
parameter (array): The ``parameter`` to update.
117117
state (dict): The optimizer's state.
118118
"""
119119
raise NotImplementedError()

0 commit comments

Comments
 (0)