Skip to content

Commit

Permalink
Replace random_shuffle with shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Dec 20, 2023
1 parent 6936124 commit a9b19b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ concurrency:
jobs:
run-tests-cpu:
runs-on: ${{ matrix.os }}
name: ${{ matrix.python-version }} ${{ matrix.build_type }}
name: ${{ matrix.os }} ${{ matrix.torch }} ${{ matrix.python-version }} ${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ concurrency:
jobs:
run-tests:
runs-on: ${{ matrix.os }}
name: ${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu-cuda-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
id: set-matrix
run: |
# outputting for debugging purposes
python ./scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch
MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch)
# python ./scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch
# MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch)
# python ./scripts/github_actions/generate_build_matrix.py --enable-cuda
# MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py --enable-cuda)
python ./scripts/github_actions/generate_build_matrix.py --enable-cuda
MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py --enable-cuda)
echo "::set-output name=matrix::${MATRIX}"
Expand Down
4 changes: 3 additions & 1 deletion k2/csrc/array_ops_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,9 @@ TEST(OpsTest, InvertPermutationTest) {
int32_t len = RandInt(0, 10);
std::vector<int32_t> permutation(len);
std::iota(permutation.begin(), permutation.end(), 0);
std::random_shuffle(permutation.begin(), permutation.end());
std::random_device rd;
std::mt19937 g(rd());
std::shuffle(permutation.begin(), permutation.end(), g);
Array1<int32_t> permutation_array(c, permutation);
Array1<int32_t> permutation_array_inv =
InvertPermutation(permutation_array);
Expand Down

0 comments on commit a9b19b4

Please sign in to comment.