Skip to content

Deprecation warning upon import of torcheval.metrics #226

@siebenkopf

Description

@siebenkopf

🐛 Describe the bug

Apparently, the @torch.jit.script decorator seems to be deprecated: https://github.com/pytorch/pytorch/blob/47f912efb0a25500c33d4dd5c0d602d8e18dfea7/torch/jit/_script.py#L1488
However, it is used in some code, for example:


so that the import of torcheval.metrics issues a deprecation warning:

>>> import torcheval.metrics
[...]\torch\jit\_script.py(1481)script()
-> "`torch.jit.script` is deprecated. Please switch to `torch.compile` or `torch.export`.",

Versions

Your code does not run on my Windows machine. Maybe replace he instructions above with:

$ python
>>> import torch
>>> torch.utils.collect_env.main()

This results in:

PyTorch version: 2.10.0+cu128                                                                                                                                           
Is debug build: False                                                                                                                                                   
CUDA used to build PyTorch: 12.8                                                                                                                                        
ROCM used to build PyTorch: N/A                                                                                                                                         
                                                                                                                                                                        
OS: Microsoft Windows 11 Pro (10.0.26200 64-Bit)                                                                                                                        
GCC version: Could not collect                                                                                                                                          
Clang version: Could not collect                                                                                                                                        
CMake version: Could not collect                                                                                                                                        
Libc version: N/A                                                                                                                                                       
                                                                                                                                                                        
Python version: 3.10.19 | packaged by Anaconda, Inc. | (main, Oct 21 2025, 16:41:31) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)                                       
Python platform: Windows-10-10.0.26200-SP0                                                                                                                              
Is CUDA available: True                                                                                                                                                 
CUDA runtime version: Could not collect                                                                                                                                 
CUDA_MODULE_LOADING set to:                                                                                                                                             
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4050 Laptop GPU                                                                                                 
Nvidia driver version: 591.44                                                                                                                                           
cuDNN version: Could not collect                                                                                                                                        
Is XPU available: False                                                                                                                                                 
HIP runtime version: N/A                                                                                                                                                
MIOpen runtime version: N/A                                                                                                                                             
Is XNNPACK available: True                                                                                                                                              
Caching allocator config: N/A                                                                                                                                           
                                                                                                                                                                        
CPU:                                                                                                                                                                    
Name: 13th Gen Intel(R) Core(TM) i7-13700H                                                                                                                              
Manufacturer: GenuineIntel                                                                                                                                              
Family: 198                                                                                                                                                             
Architecture: 9                                                                                                                                                         
ProcessorType: 3                                                                                                                                                        
DeviceID: CPU0                                                                                                                                                          
CurrentClockSpeed: 2400                                                                                                                                                 
MaxClockSpeed: 2400                                                                                                                                                     
L2CacheSize: 11776                                                                                                                                                      
L2CacheSpeed: None                                                                                                                                                      
Revision: None                                                                                                                                                          
                                                                                                                                                                        
Versions of relevant libraries:                                                                                                                                         
[pip3] mkl_fft==2.1.1                                                                                                                                                   
[pip3] mkl_random==1.3.0                                                                                                                                                
[pip3] mkl-service==2.5.2                                                                                                                                               
[pip3] numpy==2.2.5                                                                                                                                                     
[pip3] torch==2.10.0+cu128                                                                                                                                              
[pip3] torcheval==0.0.7                                                                                                                                                 
[pip3] torchvision==0.25.0+cu128                                                                                                                                        
[conda] blas                             1.0              mkl                                                                                                           
[conda] intel-openmp                     2025.0.0         haa95532_1164                                                                                                 
[conda] mkl                              2025.0.0         h5da7b33_930                                                                                                  
[conda] mkl-service                      2.5.2            py310h0b37514_0                                                                                               
[conda] mkl_fft                          2.1.1            py310h300f80d_0                                                                                               
[conda] mkl_random                       1.3.0            py310ha5e6156_0                                                                                               
[conda] numpy                            2.2.5            py310h7894be3_2                                                                                               
[conda] numpy-base                       2.2.5            py310h7794460_2                                                                                               
[conda] tbb                              2022.3.0         h90c84d6_0                                                                                                    
[conda] tbb-devel                        2022.3.0         h90c84d6_0                                                                                                    
[conda] torch                            2.10.0+cu128     pypi_0                 pypi                                                                                   
[conda] torcheval                        0.0.7            pypi_0                 pypi                                                                                   
[conda] torchvision                      0.25.0+cu128     pypi_0                 pypi                                                                                   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions