fix stack/squeeze usage

This commit is contained in:
Mike J Innes 2017-09-06 16:02:38 -04:00
parent 1946c46e29
commit d7e3f7d6e1
2 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,8 @@
using ..Flux: stack, unstack
unsqueeze(xs, dim = 1) = reshape(xs, (size(xs)[1:dim-1]..., 1, size(xs)[dim:end]...))
squeeze(xs, dim = 1) = Base.squeeze(xs, dim)
stack(xs, dim = 1) = cat(dim, unsqueeze.(xs, dim)...)
unstack(xs, dim = 1) = [slicedim(xs, dim, i) for i = 1:size(xs, dim)]
# Stateful Models

View File

@ -1,6 +1,5 @@
using DataFlow, MacroTools
using Flux: squeeze, unsqueeze, stack
using Flux.Compiler: @net, graph
using Flux.Compiler: @net, graph, stack, squeeze, unsqueeze
using DataFlow: Line, Frame
@net type Affine