From d92ea094f1ca4b56819e91c99c8db0a81611c594 Mon Sep 17 00:00:00 2001 From: Cheng Date: Sun, 8 Dec 2024 11:26:39 +0900 Subject: [PATCH] Use && instead of and (#1663) * Use && instead of and * Remove "and" in ops.cpp --- mlx/fast.cpp | 2 +- mlx/ops.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mlx/fast.cpp b/mlx/fast.cpp index f047f8027..0b5f96151 100644 --- a/mlx/fast.cpp +++ b/mlx/fast.cpp @@ -533,7 +533,7 @@ array scaled_dot_product_attention( throw std::invalid_argument(msg.str()); } } - if (mask and (*mask).ndim() > 4) { + if (mask && (*mask).ndim() > 4) { std::ostringstream msg; msg << "[scaled_dot_product_attention] the mask with shape " << (*mask).shape() << " expected to have at most rank 4"; diff --git a/mlx/ops.cpp b/mlx/ops.cpp index 2e346236a..13ae53f76 100644 --- a/mlx/ops.cpp +++ b/mlx/ops.cpp @@ -808,7 +808,7 @@ std::vector meshgrid( outputs.push_back(reshape(arrays[i], std::move(shape), s)); } - if (indexing == "xy" and ndim > 1) { + if (indexing == "xy" && ndim > 1) { Shape shape(ndim, 1); shape[1] = arrays[0].size();