| 6072 | // ggml_map_custom3_f32 |
| 6073 | |
| 6074 | static struct ggml_tensor * ggml_map_custom3_impl_f32( |
| 6075 | struct ggml_context * ctx, |
| 6076 | struct ggml_tensor * a, |
| 6077 | struct ggml_tensor * b, |
| 6078 | struct ggml_tensor * c, |
| 6079 | const ggml_custom3_op_f32_t fun, |
| 6080 | bool inplace) { |
| 6081 | bool is_node = false; |
| 6082 | |
| 6083 | if (!inplace && (a->grad || b->grad || c->grad)) { |
| 6084 | is_node = true; |
| 6085 | } |
| 6086 | |
| 6087 | struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a); |
| 6088 | |
| 6089 | ggml_set_op_params(result, (const void *) &fun, sizeof(fun)); |
| 6090 | |
| 6091 | result->op = GGML_OP_MAP_CUSTOM3_F32; |
| 6092 | result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL; |
| 6093 | result->src[0] = a; |
| 6094 | result->src[1] = b; |
| 6095 | result->src[2] = c; |
| 6096 | |
| 6097 | return result; |
| 6098 | } |
| 6099 | |
| 6100 | struct ggml_tensor * ggml_map_custom3_f32( |
| 6101 | struct ggml_context * ctx, |
no test coverage detected