| 48 | |
| 49 | template <class IntT, class InT, class OutT, class Random> |
| 50 | static void IndexedShuffle(const int64 size, const InT& input_mat, |
| 51 | OutT output_mat, Random& uniform) { |
| 52 | std::vector<IntT> permutation(size); |
| 53 | for (IntT i = 0; i < size; i++) { |
| 54 | permutation[i] = i; |
| 55 | } |
| 56 | RandomShuffle(permutation.begin(), permutation.end(), uniform); |
| 57 | for (IntT i = 0; i < size; i++) { |
| 58 | output_mat.template chip<0>(i) = input_mat.template chip<0>(permutation[i]); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | template <typename T> |
| 63 | class RandomShuffleOp : public OpKernel { |
nothing calls this directly
no test coverage detected