MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_pool_2d

Function ggml_pool_2d

subprojects/llama.cpp/ggml/src/ggml.c:4857–4886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4855// ggml_pool_2d
4856
4857struct ggml_tensor * ggml_pool_2d(
4858 struct ggml_context * ctx,
4859 struct ggml_tensor * a,
4860 enum ggml_op_pool op,
4861 int k0,
4862 int k1,
4863 int s0,
4864 int s1,
4865 float p0,
4866 float p1) {
4867 struct ggml_tensor * result;
4868 const int64_t ne[4] = {
4869 ggml_calc_pool_output_size(a->ne[0], k0, s0, p0),
4870 ggml_calc_pool_output_size(a->ne[1], k1, s1, p1),
4871 a->ne[2],
4872 a->ne[3],
4873 };
4874 GGML_ASSERT(ne[0] > 0);
4875 GGML_ASSERT(ne[1] > 0);
4876
4877 result = ggml_new_tensor(ctx, GGML_TYPE_F32, 4, ne);
4878
4879 int32_t params[] = { op, k0, k1, s0, s1, p0, p1 };
4880 ggml_set_op_params(result, params, sizeof(params));
4881
4882 result->op = GGML_OP_POOL_2D;
4883 result->src[0] = a;
4884
4885 return result;
4886}
4887
4888struct ggml_tensor * ggml_pool_2d_back(
4889 struct ggml_context * ctx,

Callers 5

buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
build_graphMethod · 0.85
ggml_vk_check_results_0Function · 0.85

Calls 3

ggml_new_tensorFunction · 0.85
ggml_set_op_paramsFunction · 0.85

Tested by 1

build_graphMethod · 0.68