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

Function Permute

tensorflow/compiler/xla/util.h:340–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338// 2. permutation.size() == input.size().
339template <typename Container>
340std::vector<typename Container::value_type> Permute(
341 absl::Span<const int64> permutation, const Container& input) {
342 using T = typename Container::value_type;
343 absl::Span<const T> data(input);
344 CHECK(IsPermutation(permutation, data.size()));
345 std::vector<T> output(data.size());
346 for (size_t i = 0; i < permutation.size(); ++i) {
347 output[permutation[i]] = data[i];
348 }
349 return output;
350}
351
352// Inverts a permutation, i.e., output_permutation[input_permutation[i]] = i.
353std::vector<int64> InversePermutation(

Callers 6

PermuteDimensionsMethod · 0.70
HandleTransposeMethod · 0.50
TEST_FFunction · 0.50
TEST_FFunction · 0.50
EmitHlo021TileMethod · 0.50

Calls 2

IsPermutationFunction · 0.85
sizeMethod · 0.45

Tested by 2

TEST_FFunction · 0.40
TEST_FFunction · 0.40