MCPcopy Create free account
hub / github.com/cactus-compute/cactus / get_grid_layout

Method get_grid_layout

cactus/engine/engine_image.cpp:140–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140std::pair<int,int> Siglip2Preprocessor::get_grid_layout(int height, int width) {
141 float aspect_ratio = (float)width / (float)height;
142 auto [grid_width, grid_height] = find_closest_aspect_ratio(aspect_ratio, width, height);
143
144 int target_width = config_.tile_size * grid_width;
145 int target_height = config_.tile_size * grid_height;
146
147 return {target_width, target_height};
148}
149
150Siglip2Preprocessor::SpatialShapeResult Siglip2Preprocessor::compute_spatial_shapes(int height, int width) {
151 if (height <= 0 || width <= 0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected