Use && instead of and (#1663)

* Use && instead of and

* Remove "and" in ops.cpp
This commit is contained in:
Cheng 2024-12-08 11:26:39 +09:00 committed by GitHub
parent 6ae5423b4a
commit d92ea094f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -533,7 +533,7 @@ array scaled_dot_product_attention(
throw std::invalid_argument(msg.str()); throw std::invalid_argument(msg.str());
} }
} }
if (mask and (*mask).ndim() > 4) { if (mask && (*mask).ndim() > 4) {
std::ostringstream msg; std::ostringstream msg;
msg << "[scaled_dot_product_attention] the mask with shape " msg << "[scaled_dot_product_attention] the mask with shape "
<< (*mask).shape() << " expected to have at most rank 4"; << (*mask).shape() << " expected to have at most rank 4";

View File

@ -808,7 +808,7 @@ std::vector<array> meshgrid(
outputs.push_back(reshape(arrays[i], std::move(shape), s)); 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 shape(ndim, 1);
shape[1] = arrays[0].size(); shape[1] = arrays[0].size();