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

Function PermuteLabels

tensorflow/core/kernels/einsum_op.cc:293–299  ·  view source on GitHub ↗

Permutes the labels according to the given permutation.

Source from the content-addressed store, hash-verified

291
292// Permutes the labels according to the given permutation.
293void PermuteLabels(const std::vector<int>& permutation, Labels* labels) {
294 Labels permuted_labels(labels->size());
295 for (int i = 0; i < labels->size(); ++i) {
296 permuted_labels[i] = (*labels)[permutation[i]];
297 }
298 labels->swap(permuted_labels);
299}
300
301// Returns a reshaped input Tensor. The underlying buffer is not copied.
302Status CopyFrom(const Tensor& input, const TensorShape& shape, Tensor* output) {

Callers 1

ReduceOperandFunction · 0.85

Calls 2

sizeMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected