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

Function ggml_pool_1d

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

Source from the content-addressed store, hash-verified

4827// ggml_pool_1d
4828
4829struct ggml_tensor * ggml_pool_1d(
4830 struct ggml_context * ctx,
4831 struct ggml_tensor * a,
4832 enum ggml_op_pool op,
4833 int k0,
4834 int s0,
4835 int p0) {
4836 const int64_t ne[4] = {
4837 ggml_calc_pool_output_size(a->ne[0], k0, s0, p0),
4838 a->ne[1],
4839 a->ne[2],
4840 a->ne[3],
4841 };
4842 GGML_ASSERT(ne[0] > 0);
4843
4844 struct ggml_tensor * result = ggml_new_tensor(ctx, GGML_TYPE_F32, 4, ne);
4845
4846 int32_t params[] = { op, k0, s0, p0 };
4847 ggml_set_op_params(result, params, sizeof(params));
4848
4849 result->op = GGML_OP_POOL_1D;
4850 result->src[0] = a;
4851
4852 return result;
4853}
4854
4855// ggml_pool_2d
4856

Callers 2

build_vitMethod · 0.85
build_graphMethod · 0.85

Calls 3

ggml_new_tensorFunction · 0.85
ggml_set_op_paramsFunction · 0.85

Tested by 1

build_graphMethod · 0.68