Skip to content

Commit

Permalink
test Clip-12
Browse files Browse the repository at this point in the history
  • Loading branch information
tianleiwu committed Sep 25, 2024
1 parent ef4177d commit 44ee680
Showing 1 changed file with 3 additions and 42 deletions.
45 changes: 3 additions & 42 deletions onnxruntime/test/providers/cpu/math/clip_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ TEST(MathOpTest, Clip_MLFloat16) {
}

TEST(MathOpTest, Clip_MLFloat16_NoMin_NoMax) {
OpTester test("Clip", 13);
OpTester test("Clip", 12);

std::vector<int64_t> dims{3};
test.AddInput<MLFloat16>("X", dims,
Expand All @@ -150,7 +150,7 @@ TEST(MathOpTest, Clip_MLFloat16_NoMin_NoMax) {
}

TEST(MathOpTest, Clip_MLFloat16_NoMax) {
OpTester test("Clip", 13);
OpTester test("Clip", 12);

std::vector<int64_t> dims{3};
test.AddInput<MLFloat16>("X", dims,
Expand All @@ -163,7 +163,7 @@ TEST(MathOpTest, Clip_MLFloat16_NoMax) {
}

TEST(MathOpTest, Clip_MLFloat16_NoMin) {
OpTester test("Clip", 13);
OpTester test("Clip", 12);

std::vector<int64_t> dims{3};
test.AddInput<MLFloat16>("X", dims,
Expand All @@ -176,45 +176,6 @@ TEST(MathOpTest, Clip_MLFloat16_NoMin) {
test.Run();
}

TEST(MathOpTest, Clip_BFloat16_NoMin_NoMax) {
OpTester test("Clip", 13);

std::vector<int64_t> dims{3};
test.AddInput<BFloat16>("X", dims,
{BFloat16(-1.0f), BFloat16(-2.0f), BFloat16(3.0f)});
test.AddOutput<BFloat16>("Y", dims,
{BFloat16(-1.0f), BFloat16(-2.0f), BFloat16(3.0f)});

test.Run();
}

TEST(MathOpTest, Clip_BFloat16_NoMax) {
OpTester test("Clip", 13);

std::vector<int64_t> dims{3};
test.AddInput<BFloat16>("X", dims,
{BFloat16(-1.0f), BFloat16(-2.0f), BFloat16(3.0f)});
test.AddInput<BFloat16>("min", {}, {BFloat16(0.0f)});
test.AddOutput<BFloat16>("Y", dims,
{BFloat16(0.0f), BFloat16(0.0f), BFloat16(3.0f)});

test.Run();
}

TEST(MathOpTest, Clip_BFloat16_NoMin) {
OpTester test("Clip", 13);

std::vector<int64_t> dims{3};
test.AddInput<BFloat16>("X", dims,
{BFloat16(-1.0f), BFloat16(-2.0f), BFloat16(3.0f)});
test.AddOptionalInputEdge<BFloat16>(); // no min
test.AddInput<BFloat16>("max", {}, {BFloat16(0.0f)});
test.AddOutput<BFloat16>("Y", dims,
{BFloat16(-1.0f), BFloat16(-2.0f), BFloat16(0.0f)});

test.Run();
}

TEST(MathOpTest, Clip_int32) {
OpTester test("Clip", 12);

Expand Down

0 comments on commit 44ee680

Please sign in to comment.