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