| 684 | // ====== Computation ====== |
| 685 | |
| 686 | void ggml_opt_prepare_alloc( |
| 687 | ggml_opt_context_t opt_ctx, |
| 688 | struct ggml_context * ctx_compute, |
| 689 | struct ggml_cgraph * gf, |
| 690 | struct ggml_tensor * inputs, |
| 691 | struct ggml_tensor * outputs) { |
| 692 | GGML_ASSERT(!opt_ctx->static_graphs); |
| 693 | opt_ctx->ctx_compute = ctx_compute; |
| 694 | opt_ctx->gf = gf; |
| 695 | opt_ctx->inputs = inputs; |
| 696 | opt_ctx->outputs = outputs; |
| 697 | } |
| 698 | |
| 699 | void ggml_opt_alloc(ggml_opt_context_t opt_ctx, bool backward) { |
| 700 | GGML_ASSERT(!opt_ctx->eval_ready); |