Mercurial > repos > public > sbplib_julia
changeset 496:f906f207571c feature/avoid_nested_inflated_tensormappings
Merge default and close branch before merge
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 05 Nov 2020 15:17:46 +0100 |
parents | df566372bb4f (current diff) 6dc6b1475563 (diff) |
children | d8075fb14418 |
files | test/testLazyTensors.jl |
diffstat | 2 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/LazyTensors/tensor_mapping.jl Thu Nov 05 13:18:24 2020 +0100 +++ b/src/LazyTensors/tensor_mapping.jl Thu Nov 05 15:17:46 2020 +0100 @@ -64,4 +64,11 @@ export range_size, domain_size +""" + eltype(::TensorMapping{T}) + +The type of elements the TensorMapping acts on. +""" +Base.eltype(::TensorMapping{T}) where T = T + # TODO: Think about boundschecking!
--- a/test/testLazyTensors.jl Thu Nov 05 13:18:24 2020 +0100 +++ b/test/testLazyTensors.jl Thu Nov 05 15:17:46 2020 +0100 @@ -12,6 +12,8 @@ @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)),(Index{Unknown}(0),Index{Unknown}(0))) == :apply + @test eltype(DummyMapping{Int,2,3}()) == Int + @test eltype(DummyMapping{Float64,2,3}()) == Float64 end @testset "Mapping transpose" begin