lazy loading note

This commit is contained in:
Mike J Innes 2017-04-17 15:56:59 +01:00
parent c3b55d1787
commit e39c24fd86

View File

@ -1,5 +1,14 @@
export tf, mxnet
# We use a lazy-loading trick to load the backend code as needed; this avoids
# the need for a hard dependency on both backends.
# This is effectively equivalent to:
# include("tensorflow/tensorflow.jl")
# using .TF
# export tf
# but instead of loading immediately, we wait until `tf` is first called.
function loadtf()
isdefined(Flux, :TF) && return
@eval include(joinpath(dirname($@__FILE__), "tensorflow/tensorflow.jl"))