MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_compute_forward_leaky_f32

Function ggml_compute_forward_leaky_f32

ggml.c:9063–9085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9061// ggml_compute_forward_leaky
9062
9063static void ggml_compute_forward_leaky_f32(
9064 const struct ggml_compute_params * params,
9065 const struct ggml_tensor * src0,
9066 struct ggml_tensor * dst) {
9067 assert(params->ith == 0);
9068 assert(ggml_are_same_shape(src0, dst));
9069
9070 if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) {
9071 return;
9072 }
9073
9074 const int n = ggml_nrows(src0);
9075 const int nc = src0->ne[0];
9076
9077 assert(dst->nb[0] == sizeof(float));
9078 assert(src0->nb[0] == sizeof(float));
9079
9080 for (int i = 0; i < n; i++) {
9081 ggml_vec_leaky_f32(nc,
9082 (float *) ((char *) dst->data + i*( dst->nb[1])),
9083 (float *) ((char *) src0->data + i*(src0->nb[1])));
9084 }
9085}
9086
9087static void ggml_compute_forward_leaky(
9088 const struct ggml_compute_params * params,

Callers 1

Calls 3

ggml_vec_leaky_f32Function · 0.85
ggml_are_same_shapeFunction · 0.70
ggml_nrowsFunction · 0.70

Tested by

no test coverage detected