diff --git a/src/include/migraphx/op/convert.hpp b/src/include/migraphx/op/convert.hpp index e320c2811c1..bcd53fd4b61 100644 --- a/src/include/migraphx/op/convert.hpp +++ b/src/include/migraphx/op/convert.hpp @@ -66,17 +66,7 @@ struct convert : unary auto type = target_type; return [type](auto x) { auto y = x; - shape::visit(type, [&](auto as) { - // clamping value between target_type's max and min doesn't work for NaNs, - if(std::isnan(x)) - { - y = as.nan(); - } - else - { - y = std::min(std::max(as(x), as.min()), as.max()); - } - }); + shape::visit(type, [&](auto as) { y = as(x); }); return y; }; } diff --git a/test/verify/test_pad_highest.cpp b/test/verify/test_pad_highest.cpp index f7e86870563..b79f6bc7d20 100644 --- a/test/verify/test_pad_highest.cpp +++ b/test/verify/test_pad_highest.cpp @@ -38,7 +38,7 @@ struct test_pad_highest : verify_program migraphx::shape s0{migraphx::shape::half_type, {2, 2}}; auto l0 = mm->add_literal(migraphx::literal{s0, data0}); migraphx::op::pad op{}; - op.value = std::numeric_limits::max(); + op.value = std::numeric_limits::max(); op.pads = {0, 0, 1, 1}; mm->add_instruction(op, l0); return p; diff --git a/test/verify/test_pad_lowest.cpp b/test/verify/test_pad_lowest.cpp index ce5e2f6d566..11652671ab3 100644 --- a/test/verify/test_pad_lowest.cpp +++ b/test/verify/test_pad_lowest.cpp @@ -38,7 +38,7 @@ struct test_pad_lowest : verify_program migraphx::shape s0{migraphx::shape::half_type, {2, 2}}; auto l0 = mm->add_literal(migraphx::literal{s0, data0}); migraphx::op::pad op{}; - op.value = std::numeric_limits::lowest(); + op.value = std::numeric_limits::lowest(); op.pads = {0, 0, 1, 1}; mm->add_instruction(op, l0); return p;