MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / IndexedShuffle

Function IndexedShuffle

tensorflow/core/kernels/random_shuffle_op.cc:50–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49template <class IntT, class InT, class OutT, class Random>
50static 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
62template <typename T>
63class RandomShuffleOp : public OpKernel {

Callers

nothing calls this directly

Calls 3

RandomShuffleFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected