comparison test/LazyTensors/tensor_mapping_test.jl @ 995:1ba8a398af9c refactor/lazy_tensors

Rename types
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 18 Mar 2022 21:14:47 +0100
parents de2df1214394
children
comparison
equal deleted inserted replaced
994:55ab7801c45f 995:1ba8a398af9c
1 using Test 1 using Test
2 using Sbplib.LazyTensors 2 using Sbplib.LazyTensors
3 3
4 @testset "Generic Mapping methods" begin 4 @testset "Generic Mapping methods" begin
5 struct DummyMapping{T,R,D} <: TensorMapping{T,R,D} end 5 struct DummyMapping{T,R,D} <: LazyTensor{T,R,D} end
6 LazyTensors.apply(m::DummyMapping{T,R,D}, v, I::Vararg{Any,R}) where {T,R,D} = :apply 6 LazyTensors.apply(m::DummyMapping{T,R,D}, v, I::Vararg{Any,R}) where {T,R,D} = :apply
7 @test range_dim(DummyMapping{Int,2,3}()) == 2 7 @test range_dim(DummyMapping{Int,2,3}()) == 2
8 @test domain_dim(DummyMapping{Int,2,3}()) == 3 8 @test domain_dim(DummyMapping{Int,2,3}()) == 3
9 @test apply(DummyMapping{Int,2,3}(), zeros(Int, (0,0,0)),0,0) == :apply 9 @test apply(DummyMapping{Int,2,3}(), zeros(Int, (0,0,0)),0,0) == :apply
10 @test eltype(DummyMapping{Int,2,3}()) == Int 10 @test eltype(DummyMapping{Int,2,3}()) == Int