TypeError: tensor() got an unexpected keyword argument 'names'
so I started  reading deep learning with pytorch, and got to the point of setting names to the dimensions inside the tensor, to make it more friendly, but as soon as I use the names argument, I get the error:
TypeError: tensor() got an unexpected keyword argument 'names'

can anyone help me out?
The code is simple:
import torch

weights_named = torch.tensor([0.2126, 0.7152, 0.0722], names=['channels'])
weights_named

Just want to run this, to see how to set names to the dimensions. Thanks in advance.

This is due to your PyTorch Version. Upgrade your Pytorch version and should work. In my case,
import torch
torch.__version__ #1.7
weights_named = torch.tensor([0.2126, 0.7152, 0.0722], names=['channels'])
# __main__:1: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change.

Named tensors and functions supporting it on latest 1.9 release, but on 1.7 (my version) is still experimental.
