Flux.jl/test/backend/tensorflow.jl
2017-05-04 13:52:31 +01:00

26 lines
416 B
Julia

using TensorFlow
Flux.loadtf()
@testset "TensorFlow" begin
xs, ys = rand(1, 20), rand(1, 20)
d = Affine(20, 10)
dt = tf(d)
@test d(xs) dt(xs)
test_tupleio(tf)
test_recurrence(tf)
test_stacktrace(tf)
@testset "Tensor interface" begin
sess = TensorFlow.Session()
X = placeholder(Float32)
Y = Tensor(d, X)
run(sess, global_variables_initializer())
@test run(sess, Y, Dict(X=>xs)) d(xs)
end
end