aboutsummaryrefslogtreecommitdiff
path: root/examples/quantize-stats/quantize-stats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quantize-stats/quantize-stats.cpp')
-rw-r--r--examples/quantize-stats/quantize-stats.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/quantize-stats/quantize-stats.cpp b/examples/quantize-stats/quantize-stats.cpp
index af1e627..203bfe8 100644
--- a/examples/quantize-stats/quantize-stats.cpp
+++ b/examples/quantize-stats/quantize-stats.cpp
@@ -1,5 +1,6 @@
#include "ggml.h"
#include "llama.h"
+#include "llama_internal.h"
#include <algorithm>
#include <cassert>
@@ -266,15 +267,13 @@ int main(int argc, char ** argv) {
}
}
- // Sort tensors for consistent output
- const auto tensors = llama_internal_get_tensor_map(ctx);
- std::map<std::string, struct ggml_tensor *> tensors_sorted { tensors.begin(), tensors.end() };
+ const auto &tensors = llama_internal_get_tensor_map(ctx);
// check layer tensors
int included_layers = 0;
int64_t max_nelements = 0;
bool is_f16 = false;
- for (const auto& kv_tensor : tensors_sorted) {
+ for (const auto& kv_tensor : tensors) {
if (!layer_included(params, kv_tensor.first)) {
continue;
}
@@ -315,7 +314,7 @@ int main(int argc, char ** argv) {
error_stats global_stats {};
- for (const auto& kv_tensor : tensors_sorted) {
+ for (const auto& kv_tensor : tensors) {
if (!layer_included(params, kv_tensor.first)) {
continue;
}