Fix: validate_input_col for partial functions#95067
Fix: validate_input_col for partial functions#95067BeckerFelix wants to merge 2 commits intopytorch:masterfrom BeckerFelix:fix_str_of_partial_fn
validate_input_col for partial functions#95067Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/95067
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d4b3ed9: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
thanks for the review. |
|
@pytorchmergebot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: This PR is too stale; the last push date was more than 3 days ago. Please rebase and try again. You can rebase by leaving the following comment on this PR: Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot rebase |
|
You don't have permissions to rebase this PR since you are a first time contributor. If you think this is a mistake, please contact PyTorch Dev Infra. |
|
@pytorchmergebot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 2 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
ejguan
left a comment
There was a problem hiding this comment.
Can you pls add tests to test/test_datapipe.py?
You can inject them into test_map_tuple_list_with_col_iterdatapipe and test_map_dict_with_col_iterdatapipe
Happy to enhance the tests. Can you be more specific of what exactly you would like to see tested, please? In both |
Sounds good to me. |
|
let me know what you think about d4b3ed9, please |
|
@pytorchbot rebase |
|
@pytorchbot successfully started a rebase job. Check the current status here |
|
Tried to rebase and push PR #95067, but it was already up to date |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes #95066 #### Proposed change: do not call `str()` on a `Callable` to determine its name #### Reasoning: Please see pytorch/pytorch#95066 for reasoning and examples #### Effect: * The code example given in pytorch/pytorch#95066 now executes instantly. * If invalid input is provided, the stacktrace now prints nicely as ``` ValueError: The function foo takes 1 parameters, but 2 are required. ``` Pull Request resolved: pytorch/pytorch#95067 Approved by: https://github.com/NivekT, https://github.com/ejguan
Fixes #95066 #### Proposed change: do not call `str()` on a `Callable` to determine its name #### Reasoning: Please see pytorch/pytorch#95066 for reasoning and examples #### Effect: * The code example given in pytorch/pytorch#95066 now executes instantly. * If invalid input is provided, the stacktrace now prints nicely as ``` ValueError: The function foo takes 1 parameters, but 2 are required. ``` Pull Request resolved: pytorch/pytorch#95067 Approved by: https://github.com/NivekT, https://github.com/ejguan
| if isinstance(fn, functools.partial): | ||
| fn_name = fn.func.__name__ | ||
| else: | ||
| fn_name = fn.__name__ |
There was a problem hiding this comment.
This causes lots of problem as not all of callable objects have __name__
I am going to do a forward fix.
There was a problem hiding this comment.
Simple example would be a nn.Module
Forward fix the problem introduced in #95067 Not all `Callable` objects have `__name__` implemented. Using `repr` as the backup solution to get function name or reference. Pull Request resolved: #96213 Approved by: https://github.com/NivekT
Forward fix the problem introduced in pytorch/pytorch#95067 Not all `Callable` objects have `__name__` implemented. Using `repr` as the backup solution to get function name or reference. Pull Request resolved: pytorch/pytorch#96213 Approved by: https://github.com/NivekT
Forward fix the problem introduced in pytorch/pytorch#95067 Not all `Callable` objects have `__name__` implemented. Using `repr` as the backup solution to get function name or reference. Pull Request resolved: pytorch/pytorch#96213 Approved by: https://github.com/NivekT
Fixes pytorch#95066 #### Proposed change: do not call `str()` on a `Callable` to determine its name #### Reasoning: Please see pytorch#95066 for reasoning and examples #### Effect: * The code example given in pytorch#95066 now executes instantly. * If invalid input is provided, the stacktrace now prints nicely as ``` ValueError: The function foo takes 1 parameters, but 2 are required. ``` Pull Request resolved: pytorch#95067 Approved by: https://github.com/NivekT, https://github.com/ejguan
Forward fix the problem introduced in pytorch#95067 Not all `Callable` objects have `__name__` implemented. Using `repr` as the backup solution to get function name or reference. Pull Request resolved: pytorch#96213 Approved by: https://github.com/NivekT
Fixes #95066
Proposed change:
do not call
str()on aCallableto determine its nameReasoning:
Please see #95066 for reasoning and examples
Effect:
validate_input_colis impractical for partial functions (with large arguments) #95066 now executes instantly.