teddykoker / torchsort

Fast, differentiable sorting and ranking in PyTorch
https://pypi.org/project/torchsort/
Apache License 2.0
765 stars 33 forks source link

RuntimeError: Tensors of type TensorImpl do not have sizes #59

Closed pumplerod closed 1 year ago

pumplerod commented 1 year ago

I recently upgraded to torch 1.12.1 and now get a runtime error with torchsort ( this was working in 1.10.1)...

torch==1.12.1+cu113 torchsort==0.1.9

import torch
import torchsort

values = torch.randn( 100, 1)
torchsort.soft_rank( values, regularization='l2', regularization_strength=0.0001)

RuntimeError: Tensors of type TensorImpl do not have sizes

teddykoker commented 1 year ago

Hi @pumplerod, you may need to reinstall torchsort after upgrading torch. Please let me know if this doesn’t fix the issue.

pumplerod commented 1 year ago

Thank you @teddykoker uninstalling and re-installing torchsort did seem to fix the issue.

teddykoker commented 1 year ago

Glad to hear! Reinstalling torchsort may be required when updating torch since it will need to be recompiled if there are any changes to the libtorch c++ library.