mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-18 18:28:12 +08:00
implemented isposinf and isneginf in one PR (#470)
* ran precommit * updated docs
This commit is contained in:
@@ -1088,6 +1088,14 @@ array isinf(const array& a, StreamOrDevice s /* = {} */) {
|
||||
return equal(a, array(std::numeric_limits<float>::infinity(), a.dtype()), s);
|
||||
}
|
||||
|
||||
array isposinf(const array& a, StreamOrDevice s) {
|
||||
return equal(a, array(std::numeric_limits<float>::infinity(), a.dtype()), s);
|
||||
}
|
||||
|
||||
array isneginf(const array& a, StreamOrDevice s) {
|
||||
return equal(a, array(-std::numeric_limits<float>::infinity(), a.dtype()), s);
|
||||
}
|
||||
|
||||
array where(
|
||||
const array& condition,
|
||||
const array& x,
|
||||
|
@@ -380,6 +380,10 @@ array isnan(const array& a, StreamOrDevice s = {});
|
||||
|
||||
array isinf(const array& a, StreamOrDevice s = {});
|
||||
|
||||
array isposinf(const array& a, StreamOrDevice s = {});
|
||||
|
||||
array isneginf(const array& a, StreamOrDevice s = {});
|
||||
|
||||
/** Select from x or y depending on condition. */
|
||||
array where(
|
||||
const array& condition,
|
||||
|
Reference in New Issue
Block a user