comparison src/LazyTensors/tuple_manipulation.jl @ 1531:9da4ab4fb85e bugfix/sbp_operators/stencil_return_type

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 11 Apr 2024 22:50:42 +0200
parents d7bc11053951
children
comparison
equal deleted inserted replaced
1456:f13857f37b8f 1531:9da4ab4fb85e
1 """ 1 """
2 split_index(dim_before, dim_view, dim_index, dim_after, I...) 2 split_index(dim_before, dim_view, dim_index, dim_after, I...)
3 3
4 Splits the multi-index `I` into two parts. One part which is expected to be 4 Splits the multi-index `I` into two parts. One part which is expected to be
5 used as a view, and one which is expected to be used as an index. 5 used as a view, and one which is expected to be used as an index.
6 Eg. 6 E.g.
7 ```julia-repl 7 ```julia-repl
8 julia> LazyTensors.split_index(1, 3, 2, 1, (1,2,3,4)...) 8 julia> LazyTensors.split_index(1, 3, 2, 1, (1,2,3,4)...)
9 ((1, Colon(), Colon(), Colon(), 4), (2, 3)) 9 ((1, Colon(), Colon(), Colon(), 4), (2, 3))
10 ``` 10 ```
11 11
31 31
32 """ 32 """
33 split_tuple(t, szs) 33 split_tuple(t, szs)
34 34
35 Split the tuple `t` into a set of tuples of the sizes given in `szs`. 35 Split the tuple `t` into a set of tuples of the sizes given in `szs`.
36 `sum(szs)` should equal `lenght(t)`. 36 `sum(szs)` should equal `length(t)`.
37 37
38 E.g 38 E.g
39 ```julia-repl 39 ```julia-repl
40 julia> LazyTensors.split_tuple((1,2,3,4,5,6), (3,1,2)) 40 julia> LazyTensors.split_tuple((1,2,3,4,5,6), (3,1,2))
41 ((1, 2, 3), (4,), (5, 6)) 41 ((1, 2, 3), (4,), (5, 6))