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
RandomAffine()
Setting a 1D tensor to RandomAffine() after instantiation got the error message as shown below:
import torch from torchvision.transforms.v2 import RandomAffine my_tensor = torch.tensor([0]) # 1D ra = RandomAffine(degrees=0) ra(my_tensor) # Error
TypeError: Input tensor should have at least two dimensions, but got 1
But, setting a 2D tensor to RandomAffine() after instantiation got other error message against the above error message as shown below:
import torch from torchvision.transforms.v2 import RandomAffine my_tensor = torch.tensor([[0, 1, 2]]) # 2D tensor ra = RandomAffine(degrees=0) ra(my_tensor) # Error
ValueError: not enough values to unpack (expected 3, got 2)
In addition, setting a 3D tensor to RandomAffine() after instantiation works as shown below:
import torch from torchvision.transforms.v2 import RandomAffine my_tensor = torch.tensor([[[0, 1, 2]]]) # 3D tensor ra = RandomAffine(degrees=0) ra(my_tensor) # tensor([[[0, 1, 2]]])
import torchvision torchvision.__version__ # '0.20.1'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
🐛 Describe the bug
Setting a 1D tensor to RandomAffine() after instantiation got the error message as shown below:
But, setting a 2D tensor to
RandomAffine()
after instantiation got other error message against the above error message as shown below:In addition, setting a 3D tensor to
RandomAffine()
after instantiation works as shown below:Versions
The text was updated successfully, but these errors were encountered: