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

Function ggml_pad_ext

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

Source from the content-addressed store, hash-verified

4989}
4990
4991struct ggml_tensor * ggml_pad_ext(
4992 struct ggml_context * ctx,
4993 struct ggml_tensor * a,
4994 int lp0,
4995 int rp0,
4996 int lp1,
4997 int rp1,
4998 int lp2,
4999 int rp2,
5000 int lp3,
5001 int rp3
5002 ) {
5003 struct ggml_tensor * result = ggml_new_tensor_4d(ctx, a->type,
5004 a->ne[0] + lp0 + rp0,
5005 a->ne[1] + lp1 + rp1,
5006 a->ne[2] + lp2 + rp2,
5007 a->ne[3] + lp3 + rp3);
5008
5009 ggml_set_op_params_i32(result, 0, lp0);
5010 ggml_set_op_params_i32(result, 1, rp0);
5011 ggml_set_op_params_i32(result, 2, lp1);
5012 ggml_set_op_params_i32(result, 3, rp1);
5013 ggml_set_op_params_i32(result, 4, lp2);
5014 ggml_set_op_params_i32(result, 5, rp2);
5015 ggml_set_op_params_i32(result, 6, lp3);
5016 ggml_set_op_params_i32(result, 7, rp3);
5017 ggml_set_op_params_i32(result, 8, 0); // not circular by default
5018
5019
5020 result->op = GGML_OP_PAD;
5021 result->src[0] = a;
5022
5023 return result;
5024}
5025
5026// ggml_pad_ext_circular
5027

Callers 5

pad_same_2dMethod · 0.85
build_graphMethod · 0.85
ggml_padFunction · 0.85
ggml_pad_ext_circularFunction · 0.85
ggml_vk_check_results_0Function · 0.85

Calls 2

ggml_new_tensor_4dFunction · 0.85
ggml_set_op_params_i32Function · 0.85

Tested by 1

build_graphMethod · 0.68