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

Function sam3_free_model

sam3.cpp:3350–3363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3348}
3349
3350void sam3_free_model(sam3_model& model) {
3351 if (model.buffer) {
3352 ggml_backend_buffer_free(model.buffer);
3353 model.buffer = nullptr;
3354 }
3355 if (model.ctx) {
3356 ggml_free(model.ctx);
3357 model.ctx = nullptr;
3358 }
3359 if (model.backend) {
3360 ggml_backend_free(model.backend);
3361 model.backend = nullptr;
3362 }
3363}
3364
3365bool sam3_is_visual_only(const sam3_model& model) {
3366 return model.hparams.visual_only != 0 || model.hparams.is_sam2() || model.hparams.is_edgetam();

Callers 15

mainFunction · 0.85
mainFunction · 0.85
test_encode_imageFunction · 0.85
run_backendFunction · 0.85
mainFunction · 0.85
test_encode_imageFunction · 0.85
run_backendFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
load_block_norm_paramsFunction · 0.85

Calls

no outgoing calls

Tested by 15

mainFunction · 0.68
mainFunction · 0.68
test_encode_imageFunction · 0.68
run_backendFunction · 0.68
mainFunction · 0.68
test_encode_imageFunction · 0.68
run_backendFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
load_block_norm_paramsFunction · 0.68