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

Function ggml_glu_impl

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

Source from the content-addressed store, hash-verified

2801// ggml_glu
2802
2803static struct ggml_tensor * ggml_glu_impl(
2804 struct ggml_context * ctx,
2805 struct ggml_tensor * a,
2806 struct ggml_tensor * b,
2807 enum ggml_glu_op op,
2808 bool swapped) {
2809 GGML_ASSERT(ggml_is_contiguous_1(a));
2810
2811 if (b) {
2812 GGML_ASSERT(ggml_is_contiguous_1(b));
2813 GGML_ASSERT(ggml_are_same_shape(a, b));
2814 GGML_ASSERT(a->type == b->type);
2815 }
2816
2817 int64_t ne[GGML_MAX_DIMS] = { a->ne[0] / 2 }; for (int i = 1; i < GGML_MAX_DIMS; i++) ne[i] = a->ne[i];
2818 struct ggml_tensor * result = ggml_new_tensor_impl(ctx, a->type, GGML_MAX_DIMS, b ? a->ne : ne, NULL, 0);
2819
2820 ggml_set_op_params_i32(result, 0, (int32_t) op);
2821 ggml_set_op_params_i32(result, 1, (int32_t) swapped);
2822
2823 result->op = GGML_OP_GLU;
2824 result->src[0] = a;
2825 result->src[1] = b;
2826
2827 return result;
2828}
2829
2830// ggml_floor
2831

Callers 15

ggml_gluFunction · 0.85
ggml_glu_splitFunction · 0.85
ggml_regluFunction · 0.85
ggml_reglu_swappedFunction · 0.85
ggml_reglu_splitFunction · 0.85
ggml_gegluFunction · 0.85
ggml_geglu_swappedFunction · 0.85
ggml_geglu_splitFunction · 0.85
ggml_swigluFunction · 0.85
ggml_swiglu_swappedFunction · 0.85
ggml_swiglu_splitFunction · 0.85
ggml_geglu_erfFunction · 0.85

Calls 4

ggml_is_contiguous_1Function · 0.85
ggml_are_same_shapeFunction · 0.85
ggml_new_tensor_implFunction · 0.85
ggml_set_op_params_i32Function · 0.85

Tested by

no test coverage detected