Skip to content

Commit

Permalink
add one test
Browse files Browse the repository at this point in the history
  • Loading branch information
GiggleLiu committed Apr 19, 2022
1 parent b5e06ca commit d0dc91b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/cueinsum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,9 @@ end
@test array_match(gradient(a->Array(einsum(EinCode(((1,2), (2,3)), ()), (a, b)))[] |> abs, a)[1], a)
b = CUDA.randn(3,3)
@test array_match(gradient(a->Array(einsum(EinCode(((1,2), (2,3)), ()), (a, b)))[] |> abs, a)[1], a)
end

@testset "adjoint dispatch" begin
u = CUDA.rand(2,2); A = CUDA.rand(2,2,3);
@test Array(ein"(ip,pql),qj -> ijl"(u', A, u)) ein"(ip,pql),qj -> ijl"(Array(CuArray(u')), Array(A), Array(u))
end

0 comments on commit d0dc91b

Please sign in to comment.