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

[Feature] Modifed implementation of BaseDataElement cuda(), cpu(), etc #1566

Open
YangyangFu opened this issue Aug 19, 2024 · 0 comments
Open

Comments

@YangyangFu
Copy link

What is the feature?

The current implementation, such as cuda only supports Tensor, BaseDataElemenet, which doesn't support data strucutures such as BaseInstance3DBoxes. See the below code:

    def cuda(self) -> 'BaseDataElement':
        """Convert all tensors to GPU in data."""
        new_data = self.new()
        for k, v in self.items():
            if isinstance(v, (torch.Tensor, BaseDataElement)):
                v = v.cuda()
                data = {k: v}
                new_data.set_data(data)
        return new_data

why not changing the implementation to work with any data strucutures that has a method of cuda?

Any other context?

No response

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