-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Open
Labels
enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: named tensorNamed tensor supportNamed tensor supporttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🚀 Feature
Right now, to create a tensor with names, we do
x = torch.randn(3, 3, 3, 3, names=('N', 'C', 'H', 'W'))
Typing the ' a lot is an inconvenience. It would be nice to explore one of the following APIs:
x = torch.randn(N=3, C=3, H=3, W=3)
(Python >= 3.6)x = torch.randn(torch.dims(N=3, C=3, H=3, W=3))
(Python >= 3.6)x = torch.randn(3, 3, 3, 3, names='N C H W')
x = torch.randn(3, 3, 3, 3, names='NCHW')
(number of characters must match number of dims)
Motivation
Type less, feel happier.
MiroFurtado, kongaskristjan and hzhangxyzEvpok, zou3519 and alanzhai219
Metadata
Metadata
Assignees
Labels
enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: named tensorNamed tensor supportNamed tensor supporttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module