Skip to content

Commit e570a22

Browse files
mcr229facebook-github-bot
authored andcommitted
fix example input generation for dynamic shapes (#4207)
Summary: Pull Request resolved: #4207 Dynamic input shapes minimum bound occaisonally generates 0, which is not a valid input shape. This change fixes that bug Reviewed By: kirklandsign Differential Revision: D59617219 fbshipit-source-id: 9c6c8bc136dcacf0bc6d80835d31892aba7e90a7
1 parent c698791 commit e570a22

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)