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

Function edgetam_load_extra_hparams

sam3.cpp:1548–1564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1546// ── EdgeTAM-specific hparams extension ────────────────────────────────────
1547
1548static bool edgetam_load_extra_hparams(std::ifstream& fin, sam3_hparams& hp) {
1549 auto rd = [&](int32_t& v) { fin.read(reinterpret_cast<char*>(&v), 4); };
1550 rd(hp.repvit_num_stages);
1551 for (int i = 0; i < 4; ++i) rd(hp.repvit_stages[i]);
1552 for (int i = 0; i < 4; ++i) rd(hp.repvit_channels[i]);
1553 rd(hp.repvit_se_ratio_x100);
1554 rd(hp.has_perceiver);
1555 rd(hp.perceiver_depth);
1556 rd(hp.perceiver_dim);
1557 rd(hp.perceiver_n_latents_1d);
1558 rd(hp.perceiver_n_latents_2d);
1559 rd(hp.perceiver_ff_mult);
1560 rd(hp.mem_attn_ca_type);
1561 rd(hp.mem_attn_ca_q_size);
1562 rd(hp.mem_attn_ca_k_size);
1563 return !fin.fail();
1564}
1565
1566// ── SAM2-specific loading ─────────────────────────────────────────────────
1567

Callers 1

sam2_load_hparamsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected