From d0dc91b495a62c60c7875351ab894da43d09d47b Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Tue, 19 Apr 2022 14:50:37 -0400 Subject: [PATCH] add one test --- test/cueinsum.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/cueinsum.jl b/test/cueinsum.jl index a2bf405..05fb8ba 100644 --- a/test/cueinsum.jl +++ b/test/cueinsum.jl @@ -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 \ No newline at end of file