Skip to content

Commit

Permalink
resolve Python precompile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xukai92 committed Apr 27, 2019
1 parent 2f101d6 commit a66dc31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/MLToolkit.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
__precompile__()

module MLToolkit

greet() = print("Welcome to Kai's machine learning toolkit!")

# Module init
function __init__()
# Bind Python libraries
copy!(axes_grid1, PyCall.pyimport("mpl_toolkits.axes_grid1"))
end

# Package level imports all go here
import AutoGrad, Knet, PyCall, PyPlot, Distributions, Reexport, Distributed

Expand Down
1 change: 0 additions & 1 deletion src/plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ end

function plot_grayimg(img, args...; ax=plt.gca())
@assert length(args) == 0 || length(args) == 2 "You can either plot a single image or declare the `n_rows` and `n_cols`"
axes_grid1 == PyCall.PyNULL() && copy!(axes_grid1, PyCall.pyimport("mpl_toolkits.axes_grid1"))
im = ax."imshow"(make_imggrid(img, args...), cmap="gray")
plt.axis("off")
divider = axes_grid1.make_axes_locatable(ax)
Expand Down

0 comments on commit a66dc31

Please sign in to comment.