⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@zaydabash
Copy link

@zaydabash zaydabash commented Jan 20, 2026

This tutorial uses a NumPy array to create a tensor, which can be confusing because some conversion APIs share memory while others copy. This PR adds a short note clarifying that torch.from_numpy shares memory when possible, while torch.tensor makes a copy, and that torch.as_tensor avoids a copy when possible.

cc @albanD @jbschlosser

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 20, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3733

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

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

@meta-cla meta-cla bot added the cla signed label Jan 20, 2026
@svekars svekars added the core Tutorials of any level of difficulty related to the core pytorch functionality label Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed core Tutorials of any level of difficulty related to the core pytorch functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants