This commit is contained in:
Ali Hamdi 2017-06-09 21:50:25 +02:00
parent 7559196ab9
commit 0b9436cfcd
2 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,7 @@ graph(::typeof(mean), x, dim=nothing) = TensorFlow.reduce_mean(x;axis=dim)
graph(::typeof(svd), x) = svd(x) graph(::typeof(svd), x) = svd(x)
graph(::typeof(size), x, dim) = TensorFlow.size(x,convert(Tensor{Int32}, dim)) graph(::typeof(size), x, dim) = TensorFlow.size(x,convert(Tensor{Int32}, dim))
graph(::typeof(size), x) = TensorFlow.size(x) graph(::typeof(size), x) = TensorFlow.size(x)
graph(::typeof(chol), args...) = TensorFlow.transpose(TensorFlow.cholesky(args...))
for op in (*, .*, .+, .^, log, exp, ceil, floor, sqrt, abs, cos, 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,

View File

@ -44,6 +44,9 @@ end
A = randn(4,5) A = randn(4,5)
@test tf(@net x -> size(x))(A) == [4,5] @test tf(@net x -> size(x))(A) == [4,5]
@test tf(@net (x,y) -> size(x,y))(A,1) == 4 @test tf(@net (x,y) -> size(x,y))(A,1) == 4
A = randn(6,5)
A = A'*A
@test tf(@net x -> chol(x))(A) chol(A)
end end
end end