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

This commit is contained in:
Johannes Gäßler authored and Georgi Gerganov committed 2024-10-01 16:07:40 +03:00
1 parent cb00020504
commit e98c1c188e
3 files changed
+11 -5

No files matched your search

+4 -1
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;