default should be used as default value in boolean_dispatch (#103463)

The original code mistakenly uses `False`, but should be `default` as passed in.

NOTE: The behavior is silently changed in an internal package. Be aware if you use it for your own purposes.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/103463
Approved by: https://github.com/davidberard98
This commit is contained in:
Rickey K. Liang
2023-06-14 03:16:28 +00:00
committed by PyTorch MergeBot
parent cbea85b416
commit 876161983d

View File

@ -476,7 +476,7 @@ def boolean_dispatch(
"""
def fn(*args, **kwargs):
dispatch_flag = False
dispatch_flag = default
if arg_name in kwargs:
dispatch_flag = kwargs[arg_name]
elif arg_index < len(args):