Flux.jl/test/backend.jl

20 lines
301 B
Julia
Raw Normal View History

2017-01-25 12:40:56 +00:00
xs = rand(20)
2017-01-25 11:33:58 +00:00
d = Affine(20, 10)
2017-01-26 18:32:59 +00:00
let dt = tf(d)
@test d(xs) dt(xs)
end
# TensorFlow native integration
using TensorFlow
let
sess = TensorFlow.Session()
X = placeholder(Float32)
Y = Tensor(d, X)
run(sess, initialize_all_variables())
2017-01-25 11:33:58 +00:00
2017-01-26 18:32:59 +00:00
@test run(sess, Y, Dict(X=>xs')) d(xs)'
end