Permutes the labels according to the given permutation.
| 291 | |
| 292 | // Permutes the labels according to the given permutation. |
| 293 | void 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. |
| 302 | Status CopyFrom(const Tensor& input, const TensorShape& shape, Tensor* output) { |
no test coverage detected