From 455b8f0ea6c24198e196e729261073fe3eb0d25e Mon Sep 17 00:00:00 2001 From: Vyacheslav Morov Date: Mon, 28 Oct 2024 14:15:58 +0100 Subject: [PATCH] Fix PyTorch-NumPy compatibility in build workflows (#1356) --- .github/workflows/main.yml | 3 +-- tests/test_torch_numpy.py | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 tests/test_torch_numpy.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1093d9bbaf..832f9f705b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -128,7 +128,7 @@ jobs: if: github.event.pull_request.draft == false strategy: matrix: - os: [ubuntu-22.04, windows-2022, macos-13] + os: [ubuntu-22.04, windows-2022, macos-14] python: ["3.8", "3.9", "3.10", "3.11", "3.12"] exclude: - os: windows-latest @@ -139,7 +139,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - architecture: "x64" cache: "pip" cache-dependency-path: setup.py - uses: actions/cache@v4 diff --git a/tests/test_torch_numpy.py b/tests/test_torch_numpy.py new file mode 100644 index 0000000000..c38284f65a --- /dev/null +++ b/tests/test_torch_numpy.py @@ -0,0 +1,7 @@ +import numpy as np +import torch + + +def test_torch_to_numpy(): + array = torch.tensor([1, 2, 3]).numpy() + assert np.array_equal(array, np.array([1, 2, 3]))