comparison src/LazyTensors/lazy_tensor_operations.jl @ 491:2dc2eac27f75 feature/outer_product

Add special methods for Identity mappings
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 05 Nov 2020 12:48:30 +0100
parents 2c0e76d5832d
children 5a600ec40ccc
comparison
equal deleted inserted replaced
477:79a88269d7d0 491:2dc2eac27f75
322 itm2 = InflatedTensorMapping(IdentityMapping{T}(domain_size(tm1)),tm2) 322 itm2 = InflatedTensorMapping(IdentityMapping{T}(domain_size(tm1)),tm2)
323 323
324 return itm1∘itm2 324 return itm1∘itm2
325 end 325 end
326 326
327 LazyOuterProduct(t1::IdentityMapping{T}, t2::IdentityMapping{T}) where T = IdentityMapping{T}(t1.size...,t2.size...)
328 LazyOuterProduct(t1::TensorMapping, t2::IdentityMapping) = InflatedTensorMapping(t1, t2)
329 LazyOuterProduct(t1::IdentityMapping, t2::TensorMapping) = InflatedTensorMapping(t1, t2)
330
327 LazyOuterProduct(tms::Vararg{TensorMapping}) = foldl(LazyOuterProduct, tms) 331 LazyOuterProduct(tms::Vararg{TensorMapping}) = foldl(LazyOuterProduct, tms)
328 332
329 ⊗(a::TensorMapping, b::TensorMapping) = LazyOuterProduct(a,b) 333 ⊗(a::TensorMapping, b::TensorMapping) = LazyOuterProduct(a,b)
330 export ⊗ 334 export ⊗
331 335