Skip to content
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

New rule: use dtype instead of converting after creation #58

Open
kit1980 opened this issue Jun 3, 2024 · 0 comments
Open

New rule: use dtype instead of converting after creation #58

kit1980 opened this issue Jun 3, 2024 · 0 comments

Comments

@kit1980
Copy link
Contributor

kit1980 commented Jun 3, 2024

For many ops dtype parameter can be provided, and it should be preferred (from readability and performance point of views) to use it instead of converting the op results to a different type.

For example, torch.arange(1, N).float() should be changed to torch.arange(1, N, dtype=torch.float32)

cc @malfet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants