Mercurial > repos > public > sbplib_julia
diff test/LazyTensors/lazy_tensor_test.jl @ 996:aa72f067e771 refactor/lazy_tensors
Rename file
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 18 Mar 2022 21:17:01 +0100 |
parents | test/LazyTensors/tensor_mapping_test.jl@1ba8a398af9c |
children | 471a948cd2b2 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/LazyTensors/lazy_tensor_test.jl Fri Mar 18 21:17:01 2022 +0100 @@ -0,0 +1,12 @@ +using Test +using Sbplib.LazyTensors + +@testset "Generic Mapping methods" begin + struct DummyMapping{T,R,D} <: LazyTensor{T,R,D} end + LazyTensors.apply(m::DummyMapping{T,R,D}, v, I::Vararg{Any,R}) where {T,R,D} = :apply + @test range_dim(DummyMapping{Int,2,3}()) == 2 + @test domain_dim(DummyMapping{Int,2,3}()) == 3 + @test apply(DummyMapping{Int,2,3}(), zeros(Int, (0,0,0)),0,0) == :apply + @test eltype(DummyMapping{Int,2,3}()) == Int + @test eltype(DummyMapping{Float64,2,3}()) == Float64 +end