We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Label Tensor when extracting only one column doesn't work.
To Reproduce
>>> x = torch.rand((10,2)) >>> labels = ['x', 'y'] >>> l_x = LabelTensor(x, labels) >>> l_x LabelTensor([[0.2713, 0.7692], [0.4961, 0.9652], [0.4201, 0.5002], [0.6814, 0.6618], [0.0545, 0.9571], [0.6296, 0.1529], [0.9426, 0.7315], [0.5458, 0.0875], [0.9378, 0.7342], [0.2751, 0.8039]]) >>> l_x[:, 0] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/dariocoscia/Desktop/PINA/pina/label_tensor.py", line 201, in __getitem__ selected_lt.labels = self.labels File "/Users/dariocoscia/Desktop/PINA/pina/label_tensor.py", line 85, in labels raise ValueError( ValueError: the tensor has not the same number of columns of the passed labels.
Expected behavior
LabelTensor([[0.2713], [0.4961], [0.4201], [0.6814], [0.0545], [0.6296], [0.9426], [0.5458], [0.9378], [0.2751]])
with ['x'] as labels.
['x']
The text was updated successfully, but these errors were encountered:
I tried for a while, but can't figure it out how to do it in a nice way. @ndem0 can I leave it to you? Thanks 😄
Sorry, something went wrong.
Solved in #167 , closing issue
ndem0
No branches or pull requests
Describe the bug
Label Tensor when extracting only one column doesn't work.
To Reproduce
Expected behavior
with
['x']
as labels.The text was updated successfully, but these errors were encountered: