Mercurial > repos > public > sbplib_julia
changeset 1226:ea5b4fca85e0 refactor/LazyTensors/tuple_manipulation
Add an example in the docstring to split_tuple
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sat, 18 Feb 2023 21:55:55 +0100 |
parents | 6567e38b05ca |
children | 06b983f0d236 |
files | src/LazyTensors/tuple_manipulation.jl |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/LazyTensors/tuple_manipulation.jl Sat Feb 18 12:24:44 2023 +0100 +++ b/src/LazyTensors/tuple_manipulation.jl Sat Feb 18 21:55:55 2023 +0100 @@ -73,6 +73,11 @@ Split the tuple `t` into a set of tuples of the sizes given in `szs`. `sum(szs)` should equal `lenght(t)`. + +E.g +```julia +split_tuple((1,2,3,4,5,6), (3,1,2)) -> (1,2,3),(4,),(5,6) +``` """ function split_tuple(t, szs) if length(t) != sum(szs; init=0)