Skip to content

Commit be60469

Browse files
committed
Refactor function names
1 parent fce05aa commit be60469

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/imatrix/imatrix.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static std::vector<float> compute_tensor_averages(const Stats & tstats) {
160160
return vec;
161161
}
162162

163-
static int compute_tensor_statistics(std::vector<tensor_statistics> & tstats, const std::string & name, const Stats & e) {
163+
static int compute_vector_statistics(std::vector<tensor_statistics> & tstats, const std::string & name, const Stats & e) {
164164
if (e.in_sum2.size() % e.counts.size() != 0) {
165165
LOG_ERR("%s: activation size mismatch for tensor %s (%zu vs %zu)\n", __func__, name.c_str(), e.counts.size(), e.in_sum2.size());
166166
return -1;;
@@ -252,7 +252,7 @@ static int compute_tensor_statistics(std::vector<tensor_statistics> & tstats, co
252252
return calc_mode;
253253
}
254254

255-
static void compute_layer_statistics(std::vector<tensor_statistics> & tstats) {
255+
static void compute_tensor_statistics(std::vector<tensor_statistics> & tstats) {
256256
static const std::regex pattern(R"(blk\.(\d+)\.)");
257257

258258
// compute the cosine similarity between the same tensors in consecutive layers
@@ -1192,14 +1192,14 @@ static bool show_statistics(const common_params & params) {
11921192
}
11931193
if (g_collector.load_imatrix(params.in_files[0].c_str())) {
11941194
for (const auto & [name, stats] :g_collector.get_mstats()) {
1195-
tensor_calc_mode =compute_tensor_statistics(ts, name, stats);
1195+
tensor_calc_mode =compute_vector_statistics(ts, name, stats);
11961196
}
11971197
} else {
11981198
LOG_ERR("\nError: %s is not a valid imatrix file\n\n", params.in_files[0].c_str());
11991199
return false;
12001200
}
12011201
if (!ts.empty()) {
1202-
compute_layer_statistics(ts);
1202+
compute_tensor_statistics(ts);
12031203
} else {
12041204
LOG_ERR("Error: cannot compute statistics for %s\n\n", params.in_files[0].c_str());
12051205
return false;

0 commit comments

Comments
 (0)