| 8758 | // ggml_compute_forward_tanh |
| 8759 | |
| 8760 | static void ggml_compute_forward_tanh_f32( |
| 8761 | const struct ggml_compute_params * params, |
| 8762 | const struct ggml_tensor * src0, |
| 8763 | struct ggml_tensor * dst) { |
| 8764 | assert(params->ith == 0); |
| 8765 | assert(ggml_are_same_shape(src0, dst)); |
| 8766 | |
| 8767 | if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { |
| 8768 | return; |
| 8769 | } |
| 8770 | |
| 8771 | const int n = ggml_nrows(src0); |
| 8772 | const int nc = src0->ne[0]; |
| 8773 | |
| 8774 | assert(dst->nb[0] == sizeof(float)); |
| 8775 | assert(src0->nb[0] == sizeof(float)); |
| 8776 | |
| 8777 | for (int i = 0; i < n; i++) { |
| 8778 | ggml_vec_tanh_f32(nc, |
| 8779 | (float *) ((char *) dst->data + i*( dst->nb[1])), |
| 8780 | (float *) ((char *) src0->data + i*(src0->nb[1]))); |
| 8781 | } |
| 8782 | } |
| 8783 | |
| 8784 | static void ggml_compute_forward_tanh( |
| 8785 | const struct ggml_compute_params * params, |
no test coverage detected