move batchone util
This commit is contained in:
parent
52cd621fb6
commit
a330b394bd
|
@ -16,9 +16,6 @@ function tf(model)
|
|||
gradients(output, input))
|
||||
end
|
||||
|
||||
batchone(x) = Batch((x,))
|
||||
batchone(x::Batch) = x
|
||||
|
||||
function batch(xs)
|
||||
dims = ndims(xs)-1
|
||||
T = Array{eltype(xs),dims}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export Batch
|
||||
export Batch, batchone
|
||||
|
||||
immutable Batch{T,S} <: AbstractVector{T}
|
||||
data::CatMat{T,S}
|
||||
|
@ -11,6 +11,9 @@ Batch(xs) = Batch(CatMat(xs))
|
|||
convert{T,S}(::Type{Batch{T,S}},storage::S) =
|
||||
Batch{T,S}(storage)
|
||||
|
||||
batchone(x) = Batch((x,))
|
||||
batchone(x::Batch) = x
|
||||
|
||||
Media.render{T<:Batch}(i::Juno.Inline, b::Type{T}) =
|
||||
render(i, Row(Juno.typ("Batch"), text"{", eltype(T), text"}"))
|
||||
|
||||
|
|
Loading…
Reference in New Issue