Skip to content

Commit

Permalink
Add not-implemented unary operators to test plan
Browse files Browse the repository at this point in the history
[skip-ci]
  • Loading branch information
vobojevicTT committed Nov 7, 2024
1 parent 0530ed4 commit 1752e67
Showing 1 changed file with 94 additions and 3 deletions.
97 changes: 94 additions & 3 deletions forge/test/operators/pytorch/eltwise_unary/test_unary.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ class TestParamsData:

__test__ = False

test_plan: TestPlan = None
test_plan_implemented: TestPlan = None
test_plan_not_implemented: TestPlan = None


class TestCollectionData:
Expand All @@ -167,9 +168,75 @@ class TestCollectionData:
implemented = TestCollection(
operators=["relu", "sqrt", "reciprocal", "sigmoid"],
)
not_implemented = TestCollection(
operators=[
"abs",
"absolute",
"acos",
"arccos",
"acosh",
"arccosh",
"angle",
"asin",
"arcsin",
"asinh",
"arcsinh",
"atan",
"arctan",
"atanh",
"arctanh",
"bitwise_not",
"ceil",
"clamp",
"clip",
"conj_physical",
"cos",
"cosh",
"deg2rad",
"digamma",
"erf",
"erfc",
"erfinv",
"exp",
"exp2",
"expm1",
"fix",
"floor",
"frac",
"lgamma",
"log",
"log10",
"log1p",
"log2",
"logit",
"i0",
"isnan",
"nan_to_num",
"neg",
"negative",
"positive",
"pow",
"rad2deg",
"reciprocal",
"round",
"rsqrt",
"sigmoid",
"sign",
"sgn",
"signbit",
"sin",
"sinc",
"sinh",
"sqrt",
"square",
"tan",
"tanh",
"trunc",
],
)


TestParamsData.test_plan = TestPlan(
TestParamsData.test_plan_implemented = TestPlan(
verify=lambda test_device, test_vector: TestVerification.verify(
test_device,
test_vector,
Expand Down Expand Up @@ -238,7 +305,31 @@ class TestCollectionData:
)


TestParamsData.test_plan_not_implemented = TestPlan(
verify=lambda test_device, test_vector: TestVerification.verify(
test_device,
test_vector,
),
collections=[
TestCollection(
operators=TestCollectionData.not_implemented.operators,
input_sources=TestCollectionCommon.single.input_sources,
input_shapes=TestCollectionCommon.single.input_shapes,
)
],
failing_rules=[
TestCollection(
operators=TestCollectionData.not_implemented.operators,
input_sources=TestCollectionCommon.single.input_sources,
input_shapes=TestCollectionCommon.single.input_shapes,
failing_reason=FailingReasons.NOT_IMPLEMENTED,
),
],
)


def get_test_plans() -> List[TestPlan]:
return [
TestParamsData.test_plan,
TestParamsData.test_plan_implemented,
TestParamsData.test_plan_not_implemented,
]

0 comments on commit 1752e67

Please sign in to comment.