Repository: pytorch
Issue: torch_np tests failing with Numpy 2.1.1
Labels: module: tests,triaged,module: numpy

### 🐛 Describe the bug

Running some tests fails with Numpy 2.1.1:
```
====================================================================================================== ERRORS =======================================================================================================
________________________________________________________________________ ERROR collecting test/torch_np/numpy_tests/core/test_multiarray.py _________________________________________________________________________
ImportError while importing test module '/lustre07/scratch/coulombc/pytorch/test/torch_np/numpy_tests/core/test_multiarray.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/python/3.11.5/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
torch_np/numpy_tests/core/test_multiarray.py:81: in <module>
    from numpy.core.tests._locales import CommaDecimalPointLocale
E   ModuleNotFoundError: No module named 'numpy.core.tests'
_______________________________________________________________________ ERROR collecting test/torch_np/numpy_tests/lib/test_function_base.py ________________________________________________________________________
ImportError while importing test module '/lustre07/scratch/coulombc/pytorch/test/torch_np/numpy_tests/lib/test_function_base.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/python/3.11.5/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
torch_np/numpy_tests/lib/test_function_base.py:41: in <module>
    from numpy.lib import delete, extract, insert, msort, place, setxor1d, unwrap, vectorize
E   ImportError: cannot import name 'delete' from 'numpy.lib' (/localscratch/coulombc.35484172.0/6652/lib/python3.11/site-packages/numpy/lib/__init__.py)
============================================================================================== short test summary info ==============================================================================================
ERROR torch_np/numpy_tests/core/test_multiarray.py
ERROR torch_np/numpy_tests/lib/test_function_base.py
```

## Reproduce
From the root directory
```
pytest torch_np
```

Renaming `numpy.core` to `numpy._core` fixes part of it.

### Versions

PyTorch version: 2.4.1
Is debug build: False
CUDA used to build PyTorch: 12.2
ROCM used to build PyTorch: N/A

OS: Gentoo Linux (x86_64)
GCC version: (Gentoo 12.3.1_p20230526 p2) 12.3.1 20230526
Clang version: Could not collect
CMake version: version 3.27.7
Libc version: glibc-2.37

Python version: 3.11.5 (main, Sep 18 2023, 12:23:42) [GCC 12.3.1 20230526] (64-bit runtime)
Python platform: Linux-4.18.0-553.16.1.el8_10.x86_64-x86_64-AMD_EPYC_7543_32-Core_Processor-with-glibc2.37
Is CUDA available: True
CUDA runtime version: 12.2
GPU models and configuration: GPU 0: NVIDIA A100-SXM4-40GB
Nvidia driver version: 550.90.07
cuDNN version: 9.2
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==2.1.1+computecanada
[pip3] torch==2.4.1+computecanada


cc @mruberry @ZainRizvi @rgommers