test: fix OPT_STEP_ADAMW for test-backend-ops (ggml/974)

This commit is contained in:
Johannes Gäßler 2024-09-30 09:55:23 +02:00 committed by Georgi Gerganov
parent cb00020504
commit e98c1c188e
No known key found for this signature in database
GPG key ID: BF970631944C16B7
3 changed files with 11 additions and 5 deletions

View file

@ -2751,7 +2751,10 @@ struct test_opt_step_adamw : public test_case {
ggml_set_param(ctx, a); // Despite tensor a having gradients the output tensor will not.
ggml_set_name(a, "a");
ggml_tensor * out = ggml_opt_step_adamw(ctx, a, alpha, beta1, beta2, eps, wd);
ggml_tensor * grad = ggml_new_tensor_4d(ctx, type, ne[0], ne[1], ne[2], ne[3]);
ggml_set_name(grad, "grad");
ggml_tensor * out = ggml_opt_step_adamw(ctx, a, grad, alpha, beta1, beta2, eps, wd);
ggml_set_name(out, "out");
return out;