Commit 303fede0 authored by Khalique's avatar Khalique
Browse files

change constructor

parent 38e604a2
...@@ -23,7 +23,12 @@ struct clip : unary<clip> ...@@ -23,7 +23,12 @@ struct clip : unary<clip>
float max_val = std::numeric_limits<float>::max(); float max_val = std::numeric_limits<float>::max();
float min_val = std::numeric_limits<float>::min(); float min_val = std::numeric_limits<float>::min();
std::string name() const { return "clip"; } clip()
{
}
clip(float max, float min) : max_val(max), min_val(min)
{}
auto apply() const auto apply() const
{ {
......
...@@ -1315,10 +1315,7 @@ struct test_clip : verify_program<test_clip> ...@@ -1315,10 +1315,7 @@ struct test_clip : verify_program<test_clip>
{ {
migraphx::program p; migraphx::program p;
auto x = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3}}); auto x = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3}});
migraphx::op::clip op; p.add_instruction(migraphx::op::clip{6.0, 0.0}, x);
op.max_val = 6.0;
op.min_val = 0.0;
p.add_instruction(op, x);
return p; return p;
} }
}; };
......
...@@ -798,10 +798,7 @@ TEST_CASE(clip_test) ...@@ -798,10 +798,7 @@ TEST_CASE(clip_test)
{ {
migraphx::program p; migraphx::program p;
auto l0 = p.add_parameter("0", migraphx::shape{migraphx::shape::float_type, {3}}); auto l0 = p.add_parameter("0", migraphx::shape{migraphx::shape::float_type, {3}});
migraphx::op::clip op; p.add_instruction(migraphx::op::clip{6.0, 0.0}, l0);
op.max_val = 6.0;
op.min_val = 0.0;
p.add_instruction(op, l0);
auto prog = migraphx::parse_onnx("clip_test.onnx"); auto prog = migraphx::parse_onnx("clip_test.onnx");
EXPECT(p == prog); EXPECT(p == prog);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment