diff --git a/.travis.yml b/.travis.yml index 0f88db97..1e63bd3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ notifications: # uncomment the following lines to override the default test script script: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - - julia -e 'VERSION < v"0.6-" && Pkg.add("TensorFlow")' - julia -e 'Pkg.add("MXNet")' - julia -e 'Pkg.clone("https://github.com/MikeInnes/DataFlow.jl")' - julia -e 'Pkg.clone(pwd()); Pkg.build("Flux"); Pkg.test("Flux"; coverage=true)' diff --git a/test/backend.jl b/test/backend.jl index 31d41807..675cfb38 100644 --- a/test/backend.jl +++ b/test/backend.jl @@ -1,19 +1,19 @@ xs = rand(20) d = Affine(20, 10) -let dt = tf(d) +@tfonly let dt = tf(d) @test d(xs) ≈ dt(xs) end -let dm = mxnet(d, (1, 20)) +@mxonly let dm = mxnet(d, (1, 20)) @test d(xs) ≈ dm(xs) end # TensorFlow native integration -using TensorFlow +@tfonly let + using TensorFlow -let sess = TensorFlow.Session() X = placeholder(Float32) Y = Tensor(d, X) diff --git a/test/runtests.jl b/test/runtests.jl index 810223ec..58cb4668 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -5,6 +5,14 @@ using DataFlow: Input, Line, Frame syntax(v::Vertex) = prettify(DataFlow.syntax(v)) syntax(x) = syntax(graph(x)) +macro mxonly(ex) + :(Base.find_in_path("MXNet") ≠ nothing && $(esc(ex))) +end + +macro tfonly(ex) + :(Base.find_in_path("TensorFlow") ≠ nothing && $(esc(ex))) +end + include("basic.jl") include("recurrent.jl") include("backend.jl")