mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-10 22:46:53 +08:00
Spelling (#342)
* spelling: accumulates Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: across Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: additional Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: against Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: among Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: array Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: at least Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: available Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: axes Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: basically Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: bfloat Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: bounds Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: broadcast Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: buffer Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: class Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: coefficients Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: collision Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: combinations Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: committing Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: computation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: consider Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: constructing Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: conversions Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: correctly Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: corresponding Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: declaration Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: default Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dependency Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: destination Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: destructor Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dimensions Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: divided Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: element-wise Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: elements Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: endianness Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: equivalent Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: explicitly Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: github Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: indices Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: irregularly Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: memory Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: metallib Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: negative Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: notable Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: optional Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: otherwise Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: overridden Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: partially Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: partition Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: perform Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: perturbations Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: positively Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: primitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: repeat Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: repeats Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: respect Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: respectively Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: result Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: rounding Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: separate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: skipping Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: structure Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: the Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: transpose Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: unnecessary Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: unneeded Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: unsupported Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --------- Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
@@ -198,7 +198,7 @@ class BatchNorm(Module):
|
||||
batch, ``C`` is the number of features or channels, and ``L`` is the
|
||||
sequence length. The output has the same shape as the input. For
|
||||
four-dimensional arrays, the shape is ``NHWC``, where ``H`` and ``W`` are
|
||||
the height and width respecitvely.
|
||||
the height and width respectively.
|
||||
|
||||
For more information on Batch Normalization, see the original paper `Batch
|
||||
Normalization: Accelerating Deep Network Training by Reducing Internal
|
||||
|
||||
@@ -253,7 +253,7 @@ class AdaDelta(Optimizer):
|
||||
rho (float, optional): The coefficient :math:`\rho` used for computing a
|
||||
running average of squared gradients. Default: ``0.9``
|
||||
eps (float, optional): The term :math:`\epsilon` added to the denominator to improve
|
||||
numerical stability. Ddefault: `1e-8`
|
||||
numerical stability. Default: `1e-8`
|
||||
"""
|
||||
|
||||
def __init__(self, learning_rate: float, rho: float = 0.9, eps: float = 1e-6):
|
||||
|
||||
@@ -507,7 +507,7 @@ void init_array(py::module_& m) {
|
||||
|
||||
array_class
|
||||
.def_property_readonly(
|
||||
"size", &array::size, R"pbdoc(Number of elments in the array.)pbdoc")
|
||||
"size", &array::size, R"pbdoc(Number of elements in the array.)pbdoc")
|
||||
.def_property_readonly(
|
||||
"ndim", &array::ndim, R"pbdoc(The array's dimension.)pbdoc")
|
||||
.def_property_readonly(
|
||||
@@ -559,7 +559,7 @@ void init_array(py::module_& m) {
|
||||
If the array has more than one dimension then the result is a nested
|
||||
list of lists.
|
||||
|
||||
The value type of the list correpsonding to the last dimension is either
|
||||
The value type of the list corresponding to the last dimension is either
|
||||
``bool``, ``int`` or ``float`` depending on the ``dtype`` of the array.
|
||||
)pbdoc")
|
||||
.def("__array__", &mlx_array_to_np)
|
||||
|
||||
@@ -1263,7 +1263,7 @@ void init_ops(py::module_& m) {
|
||||
If the axis is not specified the array is treated as a flattened
|
||||
1-D array prior to performing the take.
|
||||
|
||||
As an example, if the ``axis=1`` this is equialent to ``a[:, indices, ...]``.
|
||||
As an example, if the ``axis=1`` this is equivalent to ``a[:, indices, ...]``.
|
||||
|
||||
Args:
|
||||
a (array): Input array.
|
||||
@@ -1742,7 +1742,7 @@ void init_ops(py::module_& m) {
|
||||
"a"_a,
|
||||
py::pos_only(),
|
||||
"source"_a,
|
||||
"destiantion"_a,
|
||||
"destination"_a,
|
||||
py::kw_only(),
|
||||
"stream"_a = none,
|
||||
R"pbdoc(
|
||||
@@ -2253,7 +2253,7 @@ void init_ops(py::module_& m) {
|
||||
will be of elements less or equal to the element at the ``kth``
|
||||
index and all indices after will be of elements greater or equal
|
||||
to the element at the ``kth`` index.
|
||||
axis (int or None, optional): Optional axis to partiton over.
|
||||
axis (int or None, optional): Optional axis to partition over.
|
||||
If ``None``, this partitions over the flattened array.
|
||||
If unspecified, it defaults to ``-1``.
|
||||
|
||||
@@ -2426,13 +2426,13 @@ void init_ops(py::module_& m) {
|
||||
R"pbdoc(
|
||||
repeat(array: array, repeats: int, axis: Optional[int] = None, *, stream: Union[None, Stream, Device] = None) -> array
|
||||
|
||||
Repeate an array along a specified axis.
|
||||
Repeat an array along a specified axis.
|
||||
|
||||
Args:
|
||||
array (array): Input array.
|
||||
repeats (int): The number of repetitions for each element.
|
||||
axis (int, optional): The axis in which to repeat the array along. If
|
||||
unspecified it uses the flattened array of the input and repeates
|
||||
unspecified it uses the flattened array of the input and repeats
|
||||
along axis 0.
|
||||
stream (Stream, optional): Stream or device. Defaults to ``None``.
|
||||
|
||||
@@ -3050,7 +3050,7 @@ void init_ops(py::module_& m) {
|
||||
|
||||
Round to the given number of decimals.
|
||||
|
||||
Bascially performs:
|
||||
Basically performs:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ void init_random(py::module_& parent_module) {
|
||||
upper (scalar or array): Upper bound of the domain.
|
||||
shape (list(int), optional): The shape of the output.
|
||||
Default is ``()``.
|
||||
dtype (Dtype, optinoal): The data type of the output.
|
||||
dtype (Dtype, optional): The data type of the output.
|
||||
Default is ``float32``.
|
||||
key (array, optional): A PRNG key. Default: None.
|
||||
|
||||
|
||||
@@ -952,7 +952,7 @@ class TestArray(mlx_tests.MLXTestCase):
|
||||
b_mx = a_mx[25:-50:-3]
|
||||
self.assertTrue(np.array_equal(b_np, b_mx))
|
||||
|
||||
# Negatie slice and ascending bounds
|
||||
# Negative slice and ascending bounds
|
||||
b_np = a_np[0:20:-3]
|
||||
b_mx = a_mx[0:20:-3]
|
||||
self.assertTrue(np.array_equal(b_np, b_mx))
|
||||
|
||||
@@ -53,10 +53,10 @@ class TestBlas(mlx_tests.MLXTestCase):
|
||||
for dtype in self.dtypes:
|
||||
np_dtype = getattr(np, dtype)
|
||||
base_shapes = [4, 8, 16, 32, 64, 128]
|
||||
pertubations = [-2, -1, 0, 1, 2]
|
||||
perturbations = [-2, -1, 0, 1, 2]
|
||||
|
||||
for dim in base_shapes:
|
||||
for p in pertubations:
|
||||
for p in perturbations:
|
||||
shape_a = (dim + p, dim + p)
|
||||
shape_b = (dim + p, dim + p)
|
||||
self.__gemm_test(shape_a, shape_b, np_dtype)
|
||||
@@ -81,12 +81,12 @@ class TestBlas(mlx_tests.MLXTestCase):
|
||||
|
||||
for B, M, N, K in shapes:
|
||||
|
||||
with self.subTest(tranpose="nn"):
|
||||
with self.subTest(transpose="nn"):
|
||||
shape_a = (B, M, K)
|
||||
shape_b = (B, K, N)
|
||||
self.__gemm_test(shape_a, shape_b, np_dtype)
|
||||
|
||||
with self.subTest(tranpose="nt"):
|
||||
with self.subTest(transpose="nt"):
|
||||
shape_a = (B, M, K)
|
||||
shape_b = (B, N, K)
|
||||
self.__gemm_test(
|
||||
@@ -97,7 +97,7 @@ class TestBlas(mlx_tests.MLXTestCase):
|
||||
f_mx_b=lambda x: mx.transpose(x, (0, 2, 1)),
|
||||
)
|
||||
|
||||
with self.subTest(tranpose="tn"):
|
||||
with self.subTest(transpose="tn"):
|
||||
shape_a = (B, K, M)
|
||||
shape_b = (B, K, N)
|
||||
self.__gemm_test(
|
||||
@@ -108,7 +108,7 @@ class TestBlas(mlx_tests.MLXTestCase):
|
||||
f_mx_a=lambda x: mx.transpose(x, (0, 2, 1)),
|
||||
)
|
||||
|
||||
with self.subTest(tranpose="tt"):
|
||||
with self.subTest(transpose="tt"):
|
||||
shape_a = (B, K, M)
|
||||
shape_b = (B, N, K)
|
||||
self.__gemm_test(
|
||||
@@ -191,7 +191,7 @@ class TestBlas(mlx_tests.MLXTestCase):
|
||||
self.assertListEqual(list(c_npy.shape), list(c_mlx.shape))
|
||||
self.assertTrue(np.allclose(c_mlx, c_npy, atol=1e-6))
|
||||
|
||||
# Batched matmul with simple broadast
|
||||
# Batched matmul with simple broadcast
|
||||
a_npy = np.random.normal(0.0, 1.0 / 128, (32, 128, 16)).astype(np.float32)
|
||||
b_npy = np.random.normal(0.0, 1.0 / 128, (16, 16)).astype(np.float32)
|
||||
c_npy = a_npy @ b_npy
|
||||
@@ -213,7 +213,7 @@ class TestBlas(mlx_tests.MLXTestCase):
|
||||
self.assertListEqual(list(e_npy.shape), list(e_mlx.shape))
|
||||
self.assertTrue(np.allclose(e_mlx, e_npy, atol=1e-6))
|
||||
|
||||
# Batched and transposed matmul with simple broadast
|
||||
# Batched and transposed matmul with simple broadcast
|
||||
a_npy = np.random.normal(0.0, 1.0 / 128, (32, 128, 16)).astype(np.float32)
|
||||
b_npy = np.random.normal(0.0, 1.0 / 128, (128, 16)).astype(np.float32)
|
||||
a_mlx = mx.array(a_npy)
|
||||
|
||||
@@ -88,7 +88,7 @@ class TestOps(mlx_tests.MLXTestCase):
|
||||
self.assertEqual(a.dtype, mx.float32)
|
||||
self.assertEqual(a.item(), 3.0)
|
||||
|
||||
# Check comibinations with mlx arrays
|
||||
# Check combinations with mlx arrays
|
||||
a = mx.add(mx.array(True), False)
|
||||
self.assertEqual(a.dtype, mx.bool_)
|
||||
self.assertEqual(a.item(), True)
|
||||
|
||||
Reference in New Issue
Block a user