convertel for batch

This commit is contained in:
Mike J Innes 2017-01-26 23:37:06 +05:30
parent 8db503eafa
commit b79e536c13

View File

@ -36,3 +36,7 @@ function rebatch(xs)
B = Array{eltype(xs),dims+1}
Batch{T,B}(xs)
end
convertel(T::Type, xs::Batch) =
isa(eltype(eltype(xs)), T) ? xs :
Batch(map(x->convertel(T, x), xs))