_VariableFunctions.pyi expands to invalid utf-8 encoding. #125320
Labels
module: nn
Related to torch.nn
module: typing
Related to mypy type annotations
module: windows
Windows support for PyTorch
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃悰 Describe the bug
Torch 11.8 does not pass mypy 1.10.0 check, see python/mypy#17189
Looks like it is generated from _VariableFunctions.pyi.in
And the offset reported by mypy corresponds to line 6320 column 84 which contains these curly quotes:
Normally these would need to be utf-8 encoded, but in this case they are not and they are stored in the file as byte value 147 which is indeed an invalid utf-8 encoding. When encoded as utf-8 the curly braces become a 3 byte sequence 239, 191, 189. But it is a bit complicated figuring out where this is coming from - it appears this _VariableFunctions template is expanding a bunch of numpy functions, this one is the cov function. That function is in my env at D:\Anaconda3\envs\sr\Lib\site-packages\numpy\lib\function_base.py but the line containing that comment does not have curly quotes, so I'm not sure where the curly quotes are coming from.
Versions
Collecting environment information...
PyTorch version: 2.3.0+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A
OS: Microsoft Windows 11 Enterprise
GCC version: Could not collect
Clang version: Could not collect
CMake version: version 3.28.0-msvc1
Libc version: N/A
Python version: 3.10.14 | packaged by Anaconda, Inc. | (main, Mar 21 2024, 16:20:14) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.22631-SP0
Is CUDA available: True
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA T1000
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Architecture=9
CurrentClockSpeed=3696
DeviceID=CPU0
Family=207
L2CacheSize=2560
L2CacheSpeed=
Manufacturer=GenuineIntel
MaxClockSpeed=3696
Name=Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
ProcessorType=3
Revision=
Versions of relevant libraries:
[pip3] flake8==7.0.0
[pip3] mypy==1.10.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.4
[pip3] pytorch-lightning==2.2.3
[pip3] torch==2.3.0+cu118
[pip3] torchaudio==2.3.0+cu118
[pip3] torchmetrics==1.3.2
[pip3] torchvision==0.18.0+cu118
[conda] mkl 2021.4.0 pypi_0 pypi
[conda] numpy 1.26.4 pypi_0 pypi
[conda] pytorch-lightning 2.2.3 pypi_0 pypi
[conda] torch 2.3.0+cu118 pypi_0 pypi
[conda] torchaudio 2.3.0+cu118 pypi_0 pypi
[conda] torchmetrics 1.3.2 pypi_0 pypi
[conda] torchvision 0.18.0+cu118 pypi_0 pypi
cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @vladimir-aubrecht @iremyux @Blackhex @cristianPanaite @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki @ezyang @malfet @xuzhao9 @gramster @gqchen @pearu @nikitaved @soulitzer @lezcano @Varal7
The text was updated successfully, but these errors were encountered: