Mercurial > repos > public > sbplib_julia
comparison ext/SbplibSparseArrayKitExt.jl @ 1721:7379f492c4b3 feature/lazy_tensors/sparse_conversions
Fix typos in docstring
| author | Vidar Stiernström <vidar.stiernstrom@gmail.com> |
|---|---|
| date | Thu, 05 Sep 2024 08:31:03 -0700 |
| parents | 8787b2f9f5f8 |
| children |
comparison
equal
deleted
inserted
replaced
| 1720:7fdc348f91ff | 1721:7379f492c4b3 |
|---|---|
| 8 | 8 |
| 9 """ | 9 """ |
| 10 SparseArray(t::LazyTensor) | 10 SparseArray(t::LazyTensor) |
| 11 | 11 |
| 12 The sparse tensor representation of `t` with range dimensions to the left and | 12 The sparse tensor representation of `t` with range dimensions to the left and |
| 13 domain dimensions to the right. If `L` is a `LazyTensor` with range and | 13 domain dimensions to the right. If `L` is a `LazyTensor` with range and |
| 14 domain dimension 2 and `v` a 2-tensor, then `A = SparseArray(t)` is | 14 domain dimension 2 and `v` a 2-tensor, then `A = SparseArray(t)` is |
| 15 constructed so that `∑ₖ∑ₗA[i,j,k,l]*v[k,l] == L*v`§ | 15 constructed so that `∑ₖ∑ₗA[i,j,k,l]*v[k,l] == L*v`. |
| 16 """ | 16 """ |
| 17 function SparseArrayKit.SparseArray(t::LazyTensor) | 17 function SparseArrayKit.SparseArray(t::LazyTensor) |
| 18 v = ArrayToken(:v, domain_size(t)...) | 18 v = ArrayToken(:v, domain_size(t)...) |
| 19 return Tokens._to_tensor(t*v, range_size(t), domain_size(t)) | 19 return Tokens._to_tensor(t*v, range_size(t), domain_size(t)) |
| 20 end | 20 end |
