This commit is contained in:
Ali Hamdi 2017-06-08 07:31:23 +02:00
parent ee2e388228
commit 92616a8c3d
2 changed files with 8 additions and 1 deletions

View File

@ -30,7 +30,8 @@ graph(::typeof(mean), x, dim=nothing) = TensorFlow.reduce_mean(x;axis=dim)
graph(::typeof(svd), x) = svd(x)
for op in (*, .*, .+, .^, log, exp, ceil, floor, sqrt, abs, cos,
sin, tan, atan, asin, acos, tanh, lgamma, erf, erfc, real, imag, conj)
sin, tan, atan, asin, acos, tanh, lgamma, erf, erfc, real, imag, conj,
inv)
@eval graph(::typeof($op), args...) = $op(args...)
end

View File

@ -35,6 +35,12 @@ m = tf(f)
u,s,v = m(A)
@test maximum(abs.(u*diagm(s)*transpose(v) - A)) < error_margin
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# inv
@net f(x) = inv(x)
m = tf(f)
@test maximum(abs.(m(A)-inv(A))) < error_margin
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end