Merge pull request #25332 from lgeiger:monotonic-functions
PiperOrigin-RevId: 232071191
This commit is contained in:
commit
9167d6d159
@ -178,18 +178,14 @@ bool IsDiv(const NodeDef& node) { return node.op() == "Div"; }
|
|||||||
bool IsElementWiseMonotonic(const NodeDef& node, bool* is_non_decreasing) {
|
bool IsElementWiseMonotonic(const NodeDef& node, bool* is_non_decreasing) {
|
||||||
static const gtl::FlatSet<string>* const kMonotonicNonDecreasingOps =
|
static const gtl::FlatSet<string>* const kMonotonicNonDecreasingOps =
|
||||||
CHECK_NOTNULL((new gtl::FlatSet<string>{
|
CHECK_NOTNULL((new gtl::FlatSet<string>{
|
||||||
"Asinh", "Atanh", "Ceil", "Elu", "Erf", "Exp", "Expm1",
|
"Acosh", "Asin", "Asinh", "Atan", "Atanh", "Ceil",
|
||||||
"Floor", "Log", "Log1p", "Relu", "Relu", "Relu6", "Rint",
|
"Elu", "Erf", "Exp", "Expm1", "Floor", "Log",
|
||||||
"Selu", "Sigmoid", "Sign", "Sinh", "Sqrt", "Tanh",
|
"Log1p", "Relu", "Relu6", "Rint", "Selu", "Sigmoid",
|
||||||
|
"Sign", "Sinh", "Softsign", "Softplus", "Sqrt", "Tanh",
|
||||||
}));
|
}));
|
||||||
static const gtl::FlatSet<string>* const kMonotonicNonIncreasingOps =
|
static const gtl::FlatSet<string>* const kMonotonicNonIncreasingOps =
|
||||||
CHECK_NOTNULL((new gtl::FlatSet<string>{
|
CHECK_NOTNULL((new gtl::FlatSet<string>{"Acos", "Erfc", "Inv", "Neg",
|
||||||
"Inv",
|
"Reciprocal", "Rsqrt"}));
|
||||||
"Reciprocal",
|
|
||||||
"Erfc",
|
|
||||||
"Rsqrt",
|
|
||||||
"Neg",
|
|
||||||
}));
|
|
||||||
if (kMonotonicNonDecreasingOps->count(node.op()) > 0) {
|
if (kMonotonicNonDecreasingOps->count(node.op()) > 0) {
|
||||||
if (is_non_decreasing) {
|
if (is_non_decreasing) {
|
||||||
*is_non_decreasing = true;
|
*is_non_decreasing = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user