| 469 | } |
| 470 | |
| 471 | core::TensorValue graph_softplus_shifted(core::ModuleBuildContext & ctx, const core::TensorValue & input, float offset) { |
| 472 | auto shifted = graph_scale_bias(ctx, input, 1.0f, -offset); |
| 473 | auto exp_value = core::wrap_tensor(ggml_exp(ctx.ggml, shifted.tensor), input.shape, GGML_TYPE_F32); |
| 474 | auto plus_one = graph_scale_bias(ctx, exp_value, 1.0f, 1.0f); |
| 475 | return core::wrap_tensor(ggml_log(ctx.ggml, plus_one.tensor), input.shape, GGML_TYPE_F32); |
| 476 | } |
| 477 | |
| 478 | core::TensorValue graph_swoosh_l(core::ModuleBuildContext & ctx, const core::TensorValue & input) { |
| 479 | auto y = graph_softplus_shifted(ctx, input, 4.0f); |
no test coverage detected