-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
torch.bartlett_window not jitable #32358
Comments
I think the dither error and this error are different. I do not think we support scripting builtins like bartlet_window directly. But the error in torch audio seems legit. |
Actually, it does look to be a function. Not sure what is happening here. @driazati - can you look to see how recursive scripting is handling this python function? |
Since it's bound directly from C++ there's no code / module to compile. We could make @vincentqb for a quick workaround, you can wrap def my_bartlett_window(x: int):
return torch.bartlett_window(x)
@torch.jit.script
def my_script_function(x: int):
return my_bartlett_window(x) |
In the interpreter, this is indeed successful. However, calling the function with an integer value different from 0 or 1 yields an error. See code below, and circleci.
|
There are some problems with how def my_bartlett_window(x: int):
return torch.bartlett_window(x, dtype=torch.float)
@torch.jit.script
def my_script_function(x: int):
return my_bartlett_window(x)
print(my_bartlett_window(2))
print(my_script_function(2)) |
* workaround for bartlett_window pytorch/pytorch#32358 (comment) * only change dtype.
馃悰 Bug
Environment
PyTorch version: 1.4.0
Is debug build: No
CUDA used to build PyTorch: None
OS: Mac OSX 10.14.6
GCC version: Could not collect
CMake version: version 3.15.2
Python version: 3.7
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Versions of relevant libraries:
[pip3] numpy==1.16.4
[pip3] torch==1.1.0.post2
[pip3] torchvision==0.3.0
[conda] blas 1.0 mkl
[conda] mkl 2019.4 233
[conda] mkl-service 2.3.0 py37hfbe908c_0
[conda] mkl_fft 1.0.15 py37h5e564d8_0
[conda] mkl_random 1.1.0 py37ha771720_0
[conda] pytorch 1.4.0 py3.7_0 pytorch
[conda] torchaudio 0.5.0a0+2c49528 pypi_0 pypi
Additional context
torchaudio jitability test is failing for dither, see pytorch/audio#417.
cc @suo
The text was updated successfully, but these errors were encountered: