Skip to content

Avoid directly calling the map operator #10638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025

Conversation

ydwu4
Copy link
Contributor

@ydwu4 ydwu4 commented May 1, 2025

Summary: Calling the higher order operator directly is not recommended since it skips the safety check.

Differential Revision: D74036464

Copy link

pytorch-bot bot commented May 1, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10638

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 6f4cfd9 with merge base 385d860 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 1, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74036464

@ydwu4
Copy link
Contributor Author

ydwu4 commented May 1, 2025

@pytorchbot label "topic: not user facing"

Summary:

Calling the higher order operator directly is not recommended since it skips the safety check.

Reviewed By: angelayi

Differential Revision: D74036464
@ydwu4 ydwu4 force-pushed the export-D74036464 branch from 2f11fa4 to 6f4cfd9 Compare May 1, 2025 23:41
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74036464

@JacobSzwejbka
Copy link
Contributor

is this true for cond?

I should stop pointing people to torch.cond and instead to torch_cond and similar for all control flow ops?

@ydwu4
Copy link
Contributor Author

ydwu4 commented May 2, 2025

torch.cond is the recommended way and there isn't a torch_cond. map haven't been exposed to top-level (we have a follow up stack to fix its issues). I import the user-facing function as torch_map to avoid name collisions with python built-in map.

@facebook-github-bot facebook-github-bot merged commit 4129ebe into pytorch:main May 2, 2025
85 of 87 checks passed
jhelsby pushed a commit to jhelsby/executorch that referenced this pull request May 9, 2025
Differential Revision: D74036464

Pull Request resolved: pytorch#10638
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants