2016-10-26 11:37:48 +00:00
|
|
|
export seq, Seq, BatchSeq
|
2016-10-25 13:10:49 +00:00
|
|
|
|
2017-03-14 17:56:03 +00:00
|
|
|
struct Seq{T,S} <: AbstractVector{T}
|
2016-10-25 13:10:49 +00:00
|
|
|
data::CatMat{T,S}
|
|
|
|
end
|
|
|
|
|
|
|
|
@forward Seq.data size, eltype, getindex, setindex!, rawbatch
|
|
|
|
|
|
|
|
Seq(xs) = Seq(CatMat(xs))
|
|
|
|
|
|
|
|
convert{T,S}(::Type{Seq{T,S}},storage::S) =
|
|
|
|
Seq{T,S}(storage)
|
|
|
|
|
|
|
|
@render Juno.Inline b::Seq begin
|
|
|
|
Tree(Row(Text("Seq of "), eltype(b),
|
|
|
|
Juno.fade("[$(length(b))]")),
|
|
|
|
Juno.trim(collect(b)))
|
|
|
|
end
|
2016-10-26 11:37:48 +00:00
|
|
|
|
2017-03-14 16:51:31 +00:00
|
|
|
BatchSeq{T<:Seq} = Batch{T}
|
2017-03-28 18:54:32 +00:00
|
|
|
|
|
|
|
function rebatchseq(xs)
|
|
|
|
dims = ndims(xs)-2
|
|
|
|
T = Array{eltype(xs),dims}
|
|
|
|
S = Array{eltype(xs),dims+1}
|
|
|
|
B = Array{eltype(xs),dims+2}
|
|
|
|
Batch{Seq{T,S},B}(xs)
|
|
|
|
end
|