From d095c640c9ec063bccc4245d1bfce7d93559652c Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Mon, 1 May 2017 13:45:24 +0100 Subject: [PATCH] this should be a general util --- src/dims/batching.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dims/batching.jl b/src/dims/batching.jl index df7f81f6..bb82d11e 100644 --- a/src/dims/batching.jl +++ b/src/dims/batching.jl @@ -1,4 +1,4 @@ -export Batch, batchone +export Batch, batchone, tobatch struct Batch{T,S} <: AbstractVector{T} data::CatMat{T,S} @@ -30,3 +30,6 @@ convertel(T::Type, xs::Batch) = batchone(x) = Batch((x,)) batchone(x::Batch) = x + +tobatch(xs::Batch) = rawbatch(xs) +tobatch(xs) = tobatch(batchone(xs))