Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

nt.shape doesn't work #471

Open
Acciorocketships opened this issue Jul 13, 2022 · 4 comments
Open

nt.shape doesn't work #471

Acciorocketships opened this issue Jul 13, 2022 · 4 comments

Comments

@Acciorocketships
Copy link

🐛 Bug

shape, size, dim, nested_size, nested_dim, tensor_dim, etc don't work.

To Reproduce

Steps to reproduce the behaviour:

initialise nestedtensor nt and call nt.shape

>>> import torch
>>> x = torch.nested_tensor([torch.rand(2), torch.rand(3)])
<stdin>:1: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/NestedTensorImpl.cpp:99.)
>>> x.shape
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Internal error: NestedTensorImpl doesn't support sizes. Please file an issue on https://github.com/pytorch/nestedtensor

Expected behavior

Expected the same behaviour as seen in the example colab https://colab.research.google.com/github/pytorch/nestedtensor/blob/master/tutorials/notebooks/basic.ipynb#scrollTo=STGxLWXXVg5Z

Environment

Tested with torch 1.13.0.dev20220713 on both python3.8 and python3.9

@cpuhrsch
Copy link
Contributor

Hello @Acciorocketships,

This is actually not a but. We simply haven't migrated the entirety of NestedTensor to core yet. Could I kindly ask you to open a feature request on https://github.com/pytorch/pytorch/issues that also details your intended usage of NestedTensor?

Thanks,
Christian

@Acciorocketships
Copy link
Author

Acciorocketships commented Jul 13, 2022 via email

@cpuhrsch
Copy link
Contributor

@Acciorocketships, it is definitely possible and we're working on it cc @jbschlosser

@marwanghalib
Copy link

@Acciorocketships , I am running into the same issue. Were you able to migrate the rest of NestedTensor to core for your purposes?
Thank you.

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

No branches or pull requests

3 participants