nicer mxmodel printing

This commit is contained in:
Mike J Innes 2016-08-26 00:19:05 +01:00
parent 2b88be1c7f
commit c55f955f1e
1 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,5 @@
using MacroTools
type MXModel <: Model
model::Any
params::Dict{Symbol,Any}
@ -5,7 +7,8 @@ type MXModel <: Model
exec::mx.Executor
end
Base.show(io::IO, ::MXModel) = print(io, "MXModel(...)")
Base.show(io::IO, m::MXModel) =
print(io, "MXModel($(unblock(syntax(Flux.graph(m.model)))))")
mxdims(dims::NTuple) =
length(dims) == 1 ? (1, dims...) : reverse(dims)