MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / edgetam_make_divisible

Function edgetam_make_divisible

sam3.cpp:2066–2071  ·  view source on GitHub ↗

Helper: make_divisible(v, divisor) — rounds v up to nearest multiple of divisor

Source from the content-addressed store, hash-verified

2064
2065// Helper: make_divisible(v, divisor) — rounds v up to nearest multiple of divisor
2066static int edgetam_make_divisible(int v, int divisor) {
2067 int new_v = std::max(divisor, (v + divisor / 2) / divisor * divisor);
2068 // Make sure round-down doesn't go below 90% of v
2069 if (new_v < (int)(0.9f * v)) new_v += divisor;
2070 return new_v;
2071}
2072
2073static void edgetam_register_tensors(sam3_model& model) {
2074 const auto& hp = model.hparams;

Callers 1

edgetam_register_tensorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected