Skip to content

Commit

Permalink
Use && instead of and (#1663)
Browse files Browse the repository at this point in the history
* Use && instead of and

* Remove "and" in ops.cpp
  • Loading branch information
zcbenz authored Dec 8, 2024
1 parent 6ae5423 commit d92ea09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mlx/fast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion mlx/ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ std::vector<array> 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();
Expand Down

0 comments on commit d92ea09

Please sign in to comment.