We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4a97b9 commit 90b514eCopy full SHA for 90b514e
src/batchs.jl
@@ -22,7 +22,7 @@ function ConcatenatedBatch((; field)::Batch)
22
ConcatenatedBatch(cat(field; dims=ndims(field)), vcat([0], field .|> size .|> last |> cumsum))
23
end
24
function stack_ConcatenatedBatch(x::AbstractVector{<:ConcatenatedBatch})
25
- field = reduce(x -> cat(x, dims=ndims(first(x).field)),getfield.(x, :field))
+ field = reduce((x,y) -> cat(x,y; dims=ndims(first(x).field)),getfield.(x, :field))
26
offsets = vcat([0], getfield.(x, :lengths) .|> last)::Vector{Int} |> cumsum |> DropLast(1)
27
lengths = vcat([0], reduce(vcat,
28
zip(getfield.(x, :lengths) |> Map(Drop(1)), offsets) |> Map(((lengths, offset),) -> lengths .+ offset)
0 commit comments