MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / layer_included

Function layer_included

smallthinker/tests/test-quantize-stats.cpp:72–84  ·  view source on GitHub ↗

Check if a layer is included/excluded by command line

Source from the content-addressed store, hash-verified

70
71// Check if a layer is included/excluded by command line
72static bool layer_included(const quantize_stats_params & params, const std::string & layer) {
73 for (const auto& excluded : params.exclude_layers) {
74 if (std::regex_search(layer, std::regex(excluded))) {
75 return false;
76 }
77 }
78 for (const auto& included : params.include_layers) {
79 if (std::regex_search(layer, std::regex(included))) {
80 return true;
81 }
82 }
83 return params.include_layers.empty();
84}
85
86// Update error statistics given vectors with the before/after result of quantization
87static void update_error_stats(int64_t nelements, const float * input, const float * output, error_stats & stats) {

Callers 1

mainFunction · 0.70

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected