lazy loading note
This commit is contained in:
parent
c3b55d1787
commit
e39c24fd86
@ -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"))
|
||||
|
Loading…
Reference in New Issue
Block a user