add permutedims
This commit is contained in:
parent
d78963ab27
commit
57c733af67
@ -31,7 +31,7 @@ graph(::typeof(svd), x) = svd(x)
|
|||||||
|
|
||||||
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,
|
||||||
inv, det, transpose)
|
inv, det, transpose, permutedims)
|
||||||
@eval graph(::typeof($op), args...) = $op(args...)
|
@eval graph(::typeof($op), args...) = $op(args...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@ end
|
|||||||
@test tf(@net x -> det(x))(A) ≈ det(A)
|
@test tf(@net x -> det(x))(A) ≈ det(A)
|
||||||
A = randn(Float32,(6,3))
|
A = randn(Float32,(6,3))
|
||||||
@test tf(@net x -> transpose(x))(A) ≈ transpose(A)
|
@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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user