Skip to content

Commit

Permalink
test: make test use map
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaLGandhi committed May 1, 2024
1 parent 59c24b2 commit 453a933
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/downstream/symbol_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ idx_tupsym = SymbolicIndexingInterface.variable_index.(Ref(sys), [lorenz1.x, lor
true_grad_tupsym = zeros(length(ModelingToolkit.unknowns(sys)))
true_grad_tupsym[idx_tupsym] .= 1.

@test all(x -> x == true_grad_tupsym, gs_tup)
@test all(map(x -> x == true_grad_tupsym, gs_tup))

gs_ts, = Zygote.gradient(sol) do sol
sum(sol[[lorenz1.x, lorenz2.x], :])
end

@test all(x -> x == true_grad_vecsym, gs_ts)
@test all(map(x -> x == true_grad_vecsym, gs_ts))

@variables q(t)[1:2] = [1.0, 2.0]
eqs = [D(q[1]) ~ 2q[1]
Expand Down

0 comments on commit 453a933

Please sign in to comment.