MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / clip_n_patches

Function clip_n_patches

examples/llava/clip.cpp:1076–1080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1074}
1075
1076int clip_n_patches(const struct clip_ctx * ctx) {
1077 auto & params = ctx->vision_model.hparams;
1078
1079 return (params.image_size / params.patch_size) * (params.image_size / params.patch_size);
1080}
1081
1082size_t clip_embd_nbytes(const struct clip_ctx * ctx) {
1083 return clip_n_patches(ctx) * clip_n_mmproj_embd(ctx) * sizeof(float);

Callers 3

encode_image_with_clipFunction · 0.85
clip_embd_nbytesFunction · 0.85
process_imagesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected