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

Convert to tensor #100

Open
MilesCranmer opened this issue May 4, 2019 · 0 comments
Open

Convert to tensor #100

MilesCranmer opened this issue May 4, 2019 · 0 comments

Comments

@MilesCranmer
Copy link

Hi,

Great package.

How do I convert back to a Torch Tensor or numpy ndarray with a particular dimension ordering? What I've done so far is look at ._tensor and see what the shape is and rearrange as necessary, but I'm sure there's a better way.

E.g., like:

namedtensor.numpy(('dim1', 'dim2'))

which would output a numpy array with dimensions along the requested. The same thing for back to regular torch.

Thanks,
Miles

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

No branches or pull requests

1 participant