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

nt.shape doesn't work #471

@Acciorocketships

Description

@Acciorocketships

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions