MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / TransformLabelsOrder

Function TransformLabelsOrder

paddle/phi/kernels/impl/einsum_kernel_impl.h:137–150  ·  view source on GitHub ↗

Apply transforms to all_labels and get another all_labels

Source from the content-addressed store, hash-verified

135
136// Apply transforms to all_labels and get another all_labels
137inline std::vector<char> TransformLabelsOrder(
138 const std::vector<char>& all_labels,
139 const LabelMap& type,
140 std::vector<LabelType> new_order) {
141 std::vector<char> ret;
142 for (auto cnt_type : new_order) {
143 std::vector<char> tmp;
144 for (int c : all_labels) {
145 if (type[c] == cnt_type) tmp.push_back(c);
146 }
147 ret.insert(ret.end(), tmp.begin(), tmp.end());
148 }
149 return ret;
150}
151
152inline static void GlobalInfo(const std::vector<std::string>& op_labels,
153 const std::string& right,

Callers 2

GlobalInfoFunction · 0.85
PerformContractionFunction · 0.85

Calls 4

push_backMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected