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

Function ggml_compute_forward_elu_f32

ggml.c:8802–8824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8800// ggml_compute_forward_elu
8801
8802static void ggml_compute_forward_elu_f32(
8803 const struct ggml_compute_params * params,
8804 const struct ggml_tensor * src0,
8805 struct ggml_tensor * dst) {
8806 assert(params->ith == 0);
8807 assert(ggml_are_same_shape(src0, dst));
8808
8809 if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) {
8810 return;
8811 }
8812
8813 const int n = ggml_nrows(src0);
8814 const int nc = src0->ne[0];
8815
8816 assert(dst->nb[0] == sizeof(float));
8817 assert(src0->nb[0] == sizeof(float));
8818
8819 for (int i = 0; i < n; i++) {
8820 ggml_vec_elu_f32(nc,
8821 (float *) ((char *) dst->data + i*( dst->nb[1])),
8822 (float *) ((char *) src0->data + i*(src0->nb[1])));
8823 }
8824}
8825
8826static void ggml_compute_forward_elu(
8827 const struct ggml_compute_params * params,

Callers 1

ggml_compute_forward_eluFunction · 0.85

Calls 3

ggml_are_same_shapeFunction · 0.70
ggml_nrowsFunction · 0.70
ggml_vec_elu_f32Function · 0.70

Tested by

no test coverage detected