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.

to_tensor_mask() API should allow empty tensors #65

@izdeby

Description

@izdeby

As of right now, we are not supporting empty tensors in nested tensor when calling to_tensor_mask() method.

Example case:

        nt1 = nt.nested_tensor([
            nt.nested_tensor([
                nt.nested_tensor([
                    torch.tensor([], dtype=torch.float)
                ]),
                nt.nested_tensor([
                    torch.tensor([1], dtype=torch.float),
                    torch.tensor([1], dtype=torch.float)
                ]),
                nt.nested_tensor([
                    torch.tensor([2, 3], dtype=torch.float)
                ]),
            ])
        ])

It's unclear what the result should look like for this nested tensors.

Possible solutions to this problem is to introduce nested_size flag for nested_tensor_from_tensor_mask() method but we need more info to come up with the best solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions