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

Function ggml_unary_impl

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

Source from the content-addressed store, hash-verified

5745// ggml_unary
5746
5747static struct ggml_tensor * ggml_unary_impl(
5748 struct ggml_context * ctx,
5749 struct ggml_tensor * a,
5750 enum ggml_unary_op op,
5751 bool inplace) {
5752 GGML_ASSERT(ggml_is_contiguous_1(a));
5753
5754 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
5755
5756 ggml_set_op_params_i32(result, 0, (int32_t) op);
5757
5758 result->op = GGML_OP_UNARY;
5759 result->src[0] = a;
5760
5761 return result;
5762}
5763
5764struct ggml_tensor * ggml_unary(
5765 struct ggml_context * ctx,

Callers 2

ggml_unaryFunction · 0.85
ggml_unary_inplaceFunction · 0.85

Calls 4

ggml_is_contiguous_1Function · 0.85
ggml_view_tensorFunction · 0.85
ggml_dup_tensorFunction · 0.85
ggml_set_op_params_i32Function · 0.85

Tested by

no test coverage detected