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

torch.as_tensor(np_array) is sometimes much faster than torch.tensor(np_array) #38703

Open
mruberry opened this issue May 19, 2020 · 1 comment
Labels
module: numpy Related to numpy support, and also numpy compatibility of our operators module: performance Issues related to performance, either of kernel code or framework glue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@mruberry
Copy link
Collaborator

mruberry commented May 19, 2020

Per title. Reported internally. See related (but distinct) #13918, which discusses conversion from lists of arrays.

cc @mruberry @VitalyFedyunin @ngimel

@mruberry mruberry added module: performance Issues related to performance, either of kernel code or framework glue module: numpy Related to numpy support, and also numpy compatibility of our operators triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels May 19, 2020
@ssnl
Copy link
Collaborator

ssnl commented May 19, 2020

um, isn't this expected? as_tensor(array) doesn't copy but tensor(array) copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: numpy Related to numpy support, and also numpy compatibility of our operators module: performance Issues related to performance, either of kernel code or framework glue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants