Skip to content

Commit 9ab8d4a

Browse files
mcr229facebook-github-bot
authored andcommitted
fix example input generation for dynamic shapes
Summary: Dynamic input shapes minimum bound occaisonally generates 0, which is not a valid input shape. This change fixes that bug Differential Revision: D59617219
1 parent 3fb7083 commit 9ab8d4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backends/xnnpack/test/tester/tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def fn(x):
437437
dim_spec.max, 1000
438438
) # unbounded int max is too large
439439
lower_bound = (
440-
dim_spec.min if dim_spec.min != 2 else 1
440+
dim_spec.min if dim_spec.min >= 2 else 1
441441
) # 0/1 specialization means dim_spec.min can never be 1
442442
dim_name_to_size[dim_name] = fn(
443443
random.randint(lower_bound, upper_bound)

0 commit comments

Comments
 (0)