-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
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
TypeError with torch.nn.functional.pad #458
Comments
tfogal
added a commit
that referenced
this issue
May 24, 2024
PyTorch actually allows the `value` argument to have a different type then the input type, as long as the type of `value` is convertiable to the type of `input`. This contradicts the documentation at: https://pytorch.org/docs/stable/generated/torch.nn.functional.pad.html which indicates that the padding value, if specified, must be a float. Fixes #458.
tfogal
added a commit
that referenced
this issue
May 24, 2024
PyTorch actually allows the `value` argument to have a different type then the input type, as long as the type of `value` is convertible to the type of `input`. This contradicts the documentation at: https://pytorch.org/docs/stable/generated/torch.nn.functional.pad.html which indicates that the padding value, if specified, must be a float. Fixes #458.
tfogal
added a commit
that referenced
this issue
May 24, 2024
PyTorch actually allows the `value` argument to have a different type than the input type, as long as the type of `value` is convertible to the type of `input`. This contradicts the documentation at: https://pytorch.org/docs/stable/generated/torch.nn.functional.pad.html which indicates that the padding value, if specified, must be a float. Fixes #458.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug
NeMo's Stable Diffusion uses
torch.nn.functional.pad
as below:x = torch.nn.functional.pad(x, pad, mode="constant", value=0)
When run with
thunder.jit
, it gives aTypeError
:Expected the numbertype <class 'float'>, corresponding to the dtype float32, but found the numbertype <class 'int'>!
although
torch.nn.functional.pad
supportsvalue=0
along with floatvalue=0.0
CC: @tfogal
The text was updated successfully, but these errors were encountered: