Skip to content

Commit

Permalink
Fix offsets computation
Browse files Browse the repository at this point in the history
  • Loading branch information
nrontsis committed Oct 27, 2022
1 parent de8d8ba commit 419105f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Base.cat(inputs::ComponentArray...; dims::Int)
rest_axes = [getaxes(i)[1:end .!= dims] for i in inputs]
no_duplicate_keys = (length(inputs) == 1 || isempty(intersect(keys.(axes_to_merge)...)))
if no_duplicate_keys && length(Set(rest_axes)) == 1
offsets = cumsum(size.(inputs, 1) .- size(first(inputs), 1))
offsets = (0, cumsum(size.(inputs, dims))[1:(end - 1)]...)
merged_axis = Axis(merge(indexmap.(reindex.(axes_to_merge, offsets))...))
result_axes = (first(rest_axes)[1:(dims - 1)]..., merged_axis, first(rest_axes)[dims:end]...)
return ComponentArray(combined_data, result_axes...)
Expand Down

0 comments on commit 419105f

Please sign in to comment.