diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 98ce6095a4..5c97645f3a 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -27,7 +27,7 @@ jobs: python: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 + uses: styfle/cancel-workflow-action@3155a141048f8f89c06b4cdae32e7853e97536bc # 0.13.0 with: access_token: ${{ github.token }} @@ -88,7 +88,7 @@ jobs: python: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 + uses: styfle/cancel-workflow-action@3155a141048f8f89c06b4cdae32e7853e97536bc # 0.13.0 with: access_token: ${{ github.token }} diff --git a/.github/workflows/generate-coverage.yaml b/.github/workflows/generate-coverage.yaml index 2590b31ddc..a06bb34206 100644 --- a/.github/workflows/generate-coverage.yaml +++ b/.github/workflows/generate-coverage.yaml @@ -20,7 +20,7 @@ jobs: steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 + uses: styfle/cancel-workflow-action@0.13.0 with: access_token: ${{ github.token }} diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index a8c210d41b..d831c2d2df 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -18,7 +18,7 @@ jobs: pull-requests: write steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 + uses: styfle/cancel-workflow-action@0.13.0 with: access_token: ${{ github.token }} - name: Add Intel repository diff --git a/.github/workflows/os-llvm-sycl-build.yml b/.github/workflows/os-llvm-sycl-build.yml index 242a75828f..01acaff587 100644 --- a/.github/workflows/os-llvm-sycl-build.yml +++ b/.github/workflows/os-llvm-sycl-build.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 + uses: styfle/cancel-workflow-action@0.13.0 with: access_token: ${{ github.token }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ff7481506..27b49b24d9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,7 +38,7 @@ repos: - id: clang-format args: ["-i"] - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.15.0 + rev: v2.16.0 hooks: - id: pretty-format-toml args: [--autofix] diff --git a/dpctl/tensor/_manipulation_functions.py b/dpctl/tensor/_manipulation_functions.py index 65b027e2ba..a1ab047b16 100644 --- a/dpctl/tensor/_manipulation_functions.py +++ b/dpctl/tensor/_manipulation_functions.py @@ -829,7 +829,12 @@ def repeat(x, repeats, /, *, axis=None): if repeats.size == 1: scalar = True # bring the single element to the host - repeats = int(repeats) + if repeats.ndim == 0: + repeats = int(repeats) + else: + # Get the single element explicitly + # since non-0D arrays can not be converted to scalars + repeats = int(repeats[0]) if repeats < 0: raise ValueError("`repeats` elements must be positive") else: diff --git a/dpctl/tests/test_usm_ndarray_manipulation.py b/dpctl/tests/test_usm_ndarray_manipulation.py index 09c10340ef..b278761811 100644 --- a/dpctl/tests/test_usm_ndarray_manipulation.py +++ b/dpctl/tests/test_usm_ndarray_manipulation.py @@ -1342,6 +1342,21 @@ def test_repeat_strided_repeats(): assert dpt.all(res == x) +def test_repeat_size1_repeats(): + get_queue_or_skip() + + x = dpt.arange(5, dtype="i4") + expected_res = dpt.repeat(x, 2) + # 0D repeats + reps_0d = dpt.asarray(2, dtype="i8") + res = dpt.repeat(x, reps_0d) + assert dpt.all(res == expected_res) + # 1D repeats + reps_1d = dpt.asarray([2], dtype="i8") + res = dpt.repeat(x, reps_1d) + assert dpt.all(res == expected_res) + + def test_repeat_arg_validation(): get_queue_or_skip()