MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / parse_block_tensor_name

Function parse_block_tensor_name

server/src/gemma4/gemma4_loader.cpp:135–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135static bool parse_block_tensor_name(const char * name, int & layer_id) {
136 const char prefix[] = "blk.";
137 const size_t prefix_len = sizeof(prefix) - 1;
138 if (std::strncmp(name, prefix, prefix_len) != 0) return false;
139 const char * p = name + prefix_len;
140 if (*p < '0' || *p > '9') return false;
141 char * end = nullptr;
142 const long v = std::strtol(p, &end, 10);
143 if (!end || *end != '.' || v < 0 || v > INT32_MAX) return false;
144 layer_id = (int)v;
145 return true;
146}
147
148static bool should_load_gemma4_tensor(const char * name,
149 const TargetLoadPlan & plan) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected