| 710 | // ====== Computation ====== |
| 711 | |
| 712 | void ggml_opt_prepare_alloc( |
| 713 | ggml_opt_context_t opt_ctx, |
| 714 | struct ggml_context * ctx_compute, |
| 715 | struct ggml_cgraph * gf, |
| 716 | struct ggml_tensor * inputs, |
| 717 | struct ggml_tensor * outputs) { |
| 718 | GGML_ASSERT(!opt_ctx->static_graphs); |
| 719 | opt_ctx->ctx_compute = ctx_compute; |
| 720 | opt_ctx->gf = gf; |
| 721 | opt_ctx->inputs = inputs; |
| 722 | opt_ctx->outputs = outputs; |
| 723 | } |
| 724 | |
| 725 | void ggml_opt_alloc(ggml_opt_context_t opt_ctx, bool backward) { |
| 726 | GGML_ASSERT(!opt_ctx->eval_ready); |