Skip to content

Commit 113c253

Browse files
committed
add batch_index for FieldTuples
1 parent da45178 commit 113c253

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/field_tuples.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ tr(L::Diagonal{<:Union{Real,Complex}, <:FieldTuple}) = reduce(+, map(tr∘Diagon
117117

118118
# misc
119119
batch_length(ft::FieldTuple) = only(unique(map(batch_length, ft.fs)))
120+
batch_index(ft::FieldTuple, I) = FieldTuple(map(f -> batch_index(f, I), ft.fs))
120121
function global_rng_for(::Type{<:FieldTuple{<:Union{FS,NamedTuple{Names,FS}}}}) where {Names,FS<:Tuple}
121122
only(unique(map_tupleargs(global_rng_for, FS)))
122123
end

0 commit comments

Comments
 (0)