| 6030 | // ggml_map_custom2_f32 |
| 6031 | |
| 6032 | static struct ggml_tensor * ggml_map_custom2_impl_f32( |
| 6033 | struct ggml_context * ctx, |
| 6034 | struct ggml_tensor * a, |
| 6035 | struct ggml_tensor * b, |
| 6036 | const ggml_custom2_op_f32_t fun, |
| 6037 | bool inplace) { |
| 6038 | bool is_node = false; |
| 6039 | |
| 6040 | if (!inplace && (a->grad || b->grad)) { |
| 6041 | is_node = true; |
| 6042 | } |
| 6043 | |
| 6044 | struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a); |
| 6045 | |
| 6046 | ggml_set_op_params(result, (const void *) &fun, sizeof(fun)); |
| 6047 | |
| 6048 | result->op = GGML_OP_MAP_CUSTOM2_F32; |
| 6049 | result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL; |
| 6050 | result->src[0] = a; |
| 6051 | result->src[1] = b; |
| 6052 | |
| 6053 | return result; |
| 6054 | } |
| 6055 | |
| 6056 | struct ggml_tensor * ggml_map_custom2_f32( |
| 6057 | struct ggml_context * ctx, |
no test coverage detected