Skip to content

Commit 770cf3d

Browse files
author
Zonglin Peng
committed
[Jarvis][Nightly] address error in jarvis-nightly-operators-test-aten-leaky-relu-out
https://docs.google.com/spreadsheets/d/12DsKcvPcGgxnZ8shgn6j8PmoOQUfy5GgUg974g1iO18/edit?gid=0#gid=0 Differential Revision: [D85364558](https://our.internmc.facebook.com/intern/diff/D85364558/) [ghstack-poisoned]
1 parent 652a625 commit 770cf3d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

backends/cadence/utils/facto_util.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@ def random_size_constraint(deps: object, r: int, d: int) -> int:
390390
cp.Value.Le(lambda deps, dtype, struct: 2**2),
391391
cp.Size.Le(lambda deps, r, d: 2**3),
392392
]
393+
case "leaky_relu.default":
394+
tensor_constraints.extend(
395+
[
396+
cp.Dtype.In(lambda deps: [torch.float32]),
397+
]
398+
)
393399
case "_softmax.default":
394400
tensor_constraints.extend(
395401
[
@@ -442,6 +448,14 @@ def facto_testcase_gen( # noqa: C901
442448
spec.inspec[index].constraints.extend(
443449
[cp.Value.Ge(lambda deps, _: deps[1])]
444450
)
451+
elif in_spec.name == "negative_slope" and op_name == "leaky_relu.default":
452+
# For leaky_relu, negative_slope should be in typical range (0, 1]
453+
spec.inspec[index].constraints.extend(
454+
[
455+
cp.Value.Gt(lambda deps, dtype: 0),
456+
cp.Value.Le(lambda deps, dtype: 1.0),
457+
]
458+
)
445459
else:
446460
spec.inspec[index].constraints.extend(
447461
[

0 commit comments

Comments
 (0)