diff test/LazyTensors/lazy_tensor_operations_test.jl @ 1084:2e606d4c0ab1 feature/scalar_times_tensor

Add support for multiplying a LazyTensor with a scalar
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 14 Apr 2022 18:12:59 +0200
parents 6abbb2c6c3e4
children 2278730f9cee 1e8270c18edb 97dfca9ec054
line wrap: on
line diff
--- a/test/LazyTensors/lazy_tensor_operations_test.jl	Fri Apr 08 19:36:22 2022 +0200
+++ b/test/LazyTensors/lazy_tensor_operations_test.jl	Thu Apr 14 18:12:59 2022 +0200
@@ -181,6 +181,14 @@
 
     @test (Ã∘B̃*ComplexF64[1.,2.,3.,4.])[1] isa ComplexF64
     @test ((Ã∘B̃)'*ComplexF64[1.,2.])[1] isa ComplexF64
+
+    a = 2.
+    v = rand(3)
+    @test a*Ã isa TensorComposition
+    @test a*Ã == Ã*a
+    @test range_size(a*Ã) == range_size(Ã)
+    @test domain_size(a*Ã) == domain_size(Ã)
+    @test a*Ã*v == a.*A*v
 end