File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1284,15 +1284,18 @@ static bool show_statistics(const common_params & params) {
12841284 }
12851285
12861286 struct tensor_comparer {
1287+ bool legacy_mode;
1288+ explicit tensor_comparer (const bool legacy) : legacy_mode(legacy) {}
1289+
12871290 bool operator ()(const tensor_statistics & a, const tensor_statistics & b) const {
12881291 std::string layer, name_a, name_b;
1289- ;
12901292 process_tensor_name (a.tensor , layer, name_a);
12911293 process_tensor_name (b.tensor , layer, name_b);
1292- return name_a < name_b || (name_a == name_b && a.sum_values > b.sum_values );
1294+ return legacy_mode ? name_a < name_b || (name_a == name_b && a.sum_values > b.sum_values ) :
1295+ name_a < name_b || (name_a == name_b && a.cossim > b.cossim );
12931296 }
12941297 };
1295- std::sort (ts.begin (), ts.end (), tensor_comparer ());
1298+ std::sort (ts.begin (), ts.end (), tensor_comparer (legacy_mode ));
12961299
12971300 struct layer_stats {
12981301 float lyr_sum = 0 .0f ;
You can’t perform that action at this time.
0 commit comments