Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/lazy_tensor_operations.jl @ 1789:48eaa973159a refactor/lazy_tensors/elementwise_ops
Add TBD
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 25 Sep 2024 10:31:09 +0200 |
parents | 8b64df6cadba |
children | 368999a2e243 |
comparison
equal
deleted
inserted
replaced
1788:8b64df6cadba | 1789:48eaa973159a |
---|---|
62 end | 62 end |
63 | 63 |
64 return new{Op,T,R,D,TT}(tms) | 64 return new{Op,T,R,D,TT}(tms) |
65 end | 65 end |
66 end | 66 end |
67 # TBD: Can we introduce negation of LazyTensors? It could be done generically | |
68 # with a ScalingTensor but also using specializations for specific tensor | |
69 # types. This would allow simplification of ElementwiseTensorOperation to | |
70 # TensorSum. The implementation of `-` can be done using negation and the | |
71 # TensorSum type. We should make sure this doesn't impact the efficiency of | |
72 # for example SATs. | |
67 | 73 |
68 | 74 |
69 function ElementwiseTensorOperation{:+}(ts::Vararg{LazyTensor}) | 75 function ElementwiseTensorOperation{:+}(ts::Vararg{LazyTensor}) |
70 return ElementwiseTensorOperation{:+,eltype(ts[1]), range_dim(ts[1]), domain_dim(ts[1])}(ts) | 76 return ElementwiseTensorOperation{:+,eltype(ts[1]), range_dim(ts[1]), domain_dim(ts[1])}(ts) |
71 end | 77 end |