From 57c733af679788b47e6b59a5a4b5c9524410715c Mon Sep 17 00:00:00 2001 From: Ali Hamdi Date: Fri, 9 Jun 2017 08:25:47 +0200 Subject: [PATCH] add permutedims --- src/backend/tensorflow/graph.jl | 2 +- test/backend/tensorflow.jl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/tensorflow/graph.jl b/src/backend/tensorflow/graph.jl index 21258ecf..f5213d75 100644 --- a/src/backend/tensorflow/graph.jl +++ b/src/backend/tensorflow/graph.jl @@ -31,7 +31,7 @@ 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, - inv, det, transpose) + inv, det, transpose, permutedims) @eval graph(::typeof($op), args...) = $op(args...) end diff --git a/test/backend/tensorflow.jl b/test/backend/tensorflow.jl index 7bbb39d5..351906ed 100644 --- a/test/backend/tensorflow.jl +++ b/test/backend/tensorflow.jl @@ -31,6 +31,8 @@ end @test tf(@net x -> det(x))(A) ≈ det(A) A = randn(Float32,(6,3)) @test tf(@net x -> transpose(x))(A) ≈ transpose(A) + A = randn(Float32,(6,3,2)) + @test tf(@net (x,y) -> permutedims(x,y))(A,[3,2,1]) ≈ permutedims(A,[3,2,1]) end end