changeset 476:1b9af062ba2c feature/outer_product

Merge in default
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 02 Nov 2020 21:34:33 +0100
parents 2c0e76d5832d (current diff) 3041f8578bba (diff)
children 79a88269d7d0
files test/testLazyTensors.jl
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/testLazyTensors.jl	Mon Oct 26 23:04:30 2020 +0100
+++ b/test/testLazyTensors.jl	Mon Nov 02 21:34:33 2020 +0100
@@ -344,13 +344,26 @@
     @inferred range_size(InflatedTensorMapping(I(3,2), A, I(4))) == (3,2,4,4)
     @inferred domain_size(InflatedTensorMapping(I(3,2), A, I(4))) == (3,2,2,4)
 
+    # Test InflatedTensorMapping mapping w. before and after
     tm = InflatedTensorMapping(I(3,2), A, I(4))
     v = rand(domain_size(tm)...)
-
     @tullio IAIv[a,b,c,d] := Ã[c,i]*v[a,b,i,d]
     @test tm*v ≈ IAIv rtol=1e-14
+    @inferred LazyTensors.split_index(tm,1,1,1,1)
 
-    @inferred LazyTensors.split_index(tm,1,1,1,1)
+    # Test InflatedTensorMapping mapping w. before
+    tm = InflatedTensorMapping(I(3,2), A)
+    v = rand(domain_size(tm)...)
+    @tullio IAIv[a,b,c] := Ã[c,i]*v[a,b,i]
+    @test tm*v ≈ IAIv rtol=1e-14
+    @inferred LazyTensors.split_index(tm,1,1,1)
+
+    # Test InflatedTensorMapping mapping w. after
+    tm = InflatedTensorMapping(A,I(4))
+    v = rand(domain_size(tm)...)
+    @tullio IAIv[c,d] := Ã[c,i]*v[i,d]
+    @test tm*v ≈ IAIv rtol=1e-14
+    @inferred LazyTensors.split_index(tm,1,1)
 
     struct ScalingOperator{T,D} <: TensorMapping{T,D,D}
         λ::T