Skip to content

Commit 798a5fe

Browse files
committed
fix: fixed issue with lazy evaluation
1 parent 9739597 commit 798a5fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/batchs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ end
2424
function stack_ConcatenatedBatch(x::AbstractVector{<:ConcatenatedBatch})
2525
field = cat(getfield.(x, :field), dims=ndims(first(x).field))
2626
offsets = vcat([0], getfield.(x, :lengths) .|> last)::Vector{Int} |> cumsum
27-
lengths = zip(getfield.(x, :lengths), offsets) |> Map((lengths, offset) -> lengths .+ offsets) |> vcat
27+
lengths = zip(getfield.(x, :lengths), offsets) |> Map((lengths, offset) -> lengths .+ offsets) |> vcat |> collect
2828
ConcatenatedBatch(field, lengths)
2929
end
3030
get_slice(lengths::Vector{Int}, i::Integer) = (lengths[i]+1):lengths[i+1]

0 commit comments

Comments
 (0)