MCPcopy Create free account

hub / github.com/PABannier/sam3.cpp / functions

Functions893 in github.com/PABannier/sam3.cpp

↓ 3 callersFunctionedgetam_repvit_block_forward
RepViT block forward: token_mixer DW → optional SE → channel_mixer + residual
sam3.cpp:4732
↓ 3 callersFunctionexport_dump_as_nchw_ref
tests/test_metal_python_ref_compare.cpp:285
↓ 3 callersFunctionformat_shape
tests/test_metal_block0_stage_compare.cpp:15
↓ 3 callersFunctionformat_shape
tests/test_metal_block_stage_compare.cpp:15
↓ 3 callersFunctionformat_size
examples/benchmark.cpp:75
↓ 3 callersFunctionfused_mha_forward
Multi-head attention with fused in_proj weights.
tests/dump_phase5_reference.py:136
↓ 3 callersFunctionlayer_norm_2d
(x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, eps: float = 1e-6)
tests/dump_phase7_reference.py:147
↓ 3 callersFunctionload
(path)
tests/compare_f32_vs_f16.py:23
↓ 3 callersFunctionload_shape
(path: str)
tests/dump_phase7_reference.py:37
↓ 3 callersFunctionload_tensor
(path: str)
tests/dump_phase6_reference.py:37
↓ 3 callersFunctionload_tensor
(path)
tests/dump_phase5_reference.py:195
↓ 3 callersFunctionload_tensor
(path: str)
tests/dump_phase7_reference.py:42
↓ 3 callersFunctionmlp_forward
(x: torch.Tensor, weights: Dict[str, torch.Tensor], prefix: str,
tests/dump_phase6_reference.py:233
↓ 3 callersFunctionmlp_forward
(x: torch.Tensor, weights: Dict[str, torch.Tensor], prefix: str, num_layers: int)
tests/dump_phase7_reference.py:261
↓ 3 callersFunctionmultihead_attention_forward
(query, key, value, w_q, b_q, w_k, b_k, w_v, b_v, w_out, b_out, num_heads, att
tests/dump_ddec_from_package.py:89
↓ 3 callersFunctionnormalize_shape_4d
tests/test_metal_flash_attn_ext_block15_compare.cpp:156
↓ 3 callersFunctionrun_graph
tests/test_metal_overhead.cpp:18
↓ 3 callersFunctionsam2_maxpool_2d
MaxPool2d with kernel=2, stride=2 on spatial dims (ne[1]=W, ne[2]=H). Input: [C, W, H, B] -> output: [C, W/2, H/2, B] ggml_pool_2d operates on ne[0] a
sam3.cpp:4287
↓ 3 callersFunctionsam2_preprocess_image
SAM2 preprocessing: resize + ImageNet normalization. Returns [C, H, W] float, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225].
sam3.cpp:3522
↓ 3 callersFunctionsam3_build_ddec_graph
sam3.cpp:8749
↓ 3 callersFunctionsam3_build_seg_head_graph
Build the full segmentation head graph. Python UniversalSegmentationHead.forward: 1. Cross-attend encoder_hidden_states to prompt → updated encoder 2
sam3.cpp:8975
↓ 3 callersFunctionsam3_build_text_encoder_graph
Build the full text encoder computation graph. token_ids: [L] int32 tensor (BPE token IDs, padded to ctx_len with 0s). Must be marked as input by call
sam3.cpp:4040
↓ 3 callersFunctionsam3_build_vit_graph
Build the full ViT graph. Input: [img_size, img_size, 3, 1] (ggml convention: [W, H, C, B]) Output: [E, W, H, 1] where E=1024, W=H=72
sam3.cpp:3839
↓ 3 callersFunctionsam3_compute_axial_cis
Precompute RoPE frequencies as [N, head_dim/2, 2] (cos, sin pairs). This matches compute_axial_cis() from vitdet.py stored as real (cos, sin) instead
sam3.cpp:3559
↓ 3 callersFunctionsam3_copy_tensor_to_f32
sam3.cpp:6691
↓ 3 callersFunctionsam3_dump_model_tensor
sam3.cpp:14430
↓ 3 callersFunctionsam3_encode_vit_from_preprocessed_selective
sam3.cpp:6241
↓ 3 callersFunctionsam3_expand_token_attn_bias
sam3.cpp:7550
↓ 3 callersFunctionsam3_fill_causal_mask
Fill a pre-allocated causal mask buffer (host-side, F16). mask_data must hold L*L ggml_fp16_t values.
sam3.cpp:3943
↓ 3 callersFunctionsam3_get_video_info
sam3.cpp:12333
↓ 3 callersFunctionsam3_is_letter
Check if position i in s starts a Unicode letter. Handles ASCII letters + treats any multibyte UTF-8 start byte as a letter. This is a reasonable appr
sam3.cpp:1131
↓ 3 callersFunctionsam3_meta_get_int
sam3.cpp:12640
↓ 3 callersFunctionsam3_mlp_forward
MLP forward: N layers with ReLU (except last), optional sigmoid on last
sam3.cpp:10511
↓ 3 callersFunctionsam3_pe_encode_coord
Random Fourier positional encoding for a single (x, y) coordinate coords_norm: normalized to [0, 1], pe_gaussian: PyTorch row-major [2, 128] Output: [
sam3.cpp:10273
↓ 3 callersFunctionsam3_profile_op_counts
Helper: capture op counts from a graph.
sam3.cpp:5027
↓ 3 callersFunctionsam3_profile_run_subgraph
Helper: run a single sub-graph timing trial. Allocates, warms up, times n_iter runs, reads output tensors, then frees. output_tensors: list of tensors
sam3.cpp:5041
↓ 3 callersFunctionsam3_test_dump_text_encoder
sam3.cpp:12650
↓ 3 callersFunctionsave_ggml_bd
(path: str, x_bd: torch.Tensor)
tests/dump_phase6_reference.py:52
↓ 3 callersMethodsigmoid_bias
sam3.cpp:231
↓ 3 callersMethodsigmoid_scale
sam3.cpp:230
↓ 3 callersFunctionstbi__addsizes_valid
return 1 if the sum is valid, 0 on overflow. negative terms are considered invalid.
stb/stb_image.h:1002
↓ 3 callersFunctionstbi__convert_format16
stb/stb_image.h:1812
↓ 3 callersFunctionstbi__decode_jpeg_header
stb/stb_image.h:3365
↓ 3 callersFunctionstbi__free_jpeg_components
stb/stb_image.h:3242
↓ 3 callersFunctionstbi__hdr_convert
stb/stb_image.h:7131
↓ 3 callersFunctionstbi__info_main
stb/stb_image.h:7632
↓ 3 callersFunctionstbi__is_16_main
stb/stb_image.h:7674
↓ 3 callersFunctionstbi__load_and_postprocess_16bit
stb/stb_image.h:1286
↓ 3 callersFunctionstbi__loadf_main
stb/stb_image.h:1460
↓ 3 callersFunctionstbi__mad4sizes_valid
stb/stb_image.h:1039
↓ 3 callersFunctionstbi__malloc_mad4
stb/stb_image.h:1062
↓ 3 callersFunctionstbi__pic_is4
stb/stb_image.h:6336
↓ 3 callersFunctionstbi__pnm_getinteger
stb/stb_image.h:7567
↓ 3 callersFunctionstbi__pnm_info
stb/stb_image.h:7581
↓ 3 callersFunctionstbi__pnm_skip_whitespace
stb/stb_image.h:7548
↓ 3 callersFunctionstbi__zeof
stb/stb_image.h:4192
↓ 3 callersFunctionstbi__zexpand
stb/stb_image.h:4273
↓ 3 callersFunctionstbi__zhuffman_decode
stb/stb_image.h:4243
↓ 3 callersFunctionstbiw__encode_png_line
@OPTIMIZE: provide an option that always forces left-predict or paeth predict
stb/stb_image_write.h:1092
↓ 3 callersFunctionstbiw__outfile
stb/stb_image_write.h:478
↓ 3 callersFunctionstbiw__paeth
stb/stb_image_write.h:1083
↓ 3 callersFunctionstbiw__wpcrc
stb/stb_image_write.h:1077
↓ 3 callersFunctionstbiw__write3
stb/stb_image_write.h:406
↓ 3 callersFunctionstbiw__write_pixel
stb/stb_image_write.h:418
↓ 3 callersFunctiontrim_shape
tests/test_metal_block0_stage_compare.cpp:27
↓ 2 callersFunctionadd_instance_from_prompts
examples/main_video.cpp:290
↓ 2 callersFunctionadd_ref
tests/test_metal_block_stage_compare.cpp:121
↓ 2 callersFunctionbasename_of
examples/main_video.cpp:40
↓ 2 callersFunctioncompare_exact_i32
tests/test_utils.h:149
↓ 2 callersFunctioncompare_results
tests/test_visual_only_compare.cpp:35
↓ 2 callersFunctioncompute_axial_cis
(dim, end_x, end_y, theta=10000.0, scale_pos=1.0, offset=0)
tests/dump_phase3_reference.py:49
↓ 2 callersFunctioncompute_axial_cis
(dim, end_x, end_y, theta=10000.0, scale_pos=1.0, offset=0)
tests/dump_vit_reference.py:33
↓ 2 callersFunctioncount_fg
tests/test_visual_only_compare.cpp:29
↓ 2 callersFunctioncreate_backend
tests/test_metal_vit_upstream_compare.cpp:73
↓ 2 callersFunctioncreate_backend
tests/test_metal_flash_attn_ext_block15_compare.cpp:141
↓ 2 callersFunctioncreate_tracker
examples/main_video.cpp:218
↓ 2 callersFunctionedgetam_perceiver_layer_forward
Helper: build one perceiver layer on latents, given features x. latents: [D, N_lat, batch] (D=64, N_lat = n latent tokens) x: [D, N_x, batch
sam3.cpp:5437
↓ 2 callersFunctionedgetam_repvit_downsample_forward
Downsample: pre_block → spatial DW s=2 → channel expand → FFN + residual
sam3.cpp:4768
↓ 2 callersFunctionends_with
examples/benchmark.cpp:94
↓ 2 callersFunctionfind_instance_at
Check if a click position lands on any tracked instance mask. Returns the instance_id or -1.
examples/main_video.cpp:277
↓ 2 callersFunctionformat_shape
tests/test_metal_vit_upstream_compare.cpp:36
↓ 2 callersFunctiongen_value
tests/test_metal_conv_transpose_2d.cpp:92
↓ 2 callersFunctionget_abs_pos
(abs_pos, has_cls_token, hw, tiling=False)
tests/dump_vit_reference.py:87
↓ 2 callersFunctionget_pairs
(word)
scripts/verify_tokenizer.py:33
↓ 2 callersFunctionggml_dump_to_nchw_flat
tests/test_metal_python_ref_compare.cpp:105
↓ 2 callersMethodis_global_attn
sam3.cpp:183
↓ 2 callersFunctionload_ggml_bd
(path: str)
tests/dump_phase7_reference.py:48
↓ 2 callersFunctionload_image
examples/main_image.cpp:209
↓ 2 callersFunctionload_ref_i32
tests/test_utils.h:89
↓ 2 callersFunctionload_shape_file
tests/test_utils.h:50
↓ 2 callersFunctionload_tensor
(path)
tests/compare_tensors.py:6
↓ 2 callersFunctionload_tensor
(path)
tests/check_preprocessing.py:6
↓ 2 callersFunctionload_tensor
(path)
tests/dump_cpp_preprocessed.py:33
↓ 2 callersFunctionload_tensor
(path)
tests/compare_mask_decoder.py:43
↓ 2 callersFunctionload_tensor
(path)
tests/test_full_pipeline.py:11
↓ 2 callersFunctionload_tensor
Load a .bin + .shape tensor pair.
tests/compare_ddec_tensors.py:15
↓ 2 callersFunctionmetrics
(ref, cpp)
tests/compare_f32_vs_f16.py:28
↓ 2 callersFunctionparse_int_list
(field: str)
tests/dump_phase7_reference.py:112
↓ 2 callersFunctionparse_points
(field: str)
tests/dump_phase6_reference.py:91
↓ 2 callersFunctionparse_points
tests/test_metal_phase6.cpp:21
← previousnext →201–300 of 893, ranked by callers