add diag
This commit is contained in:
parent
e6db3b0e89
commit
6dfb554e95
@ -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, permutedims, cat, length)
|
||||
inv, det, transpose, permutedims, cat, length, diag)
|
||||
@eval graph(::typeof($op), args...) = $op(args...)
|
||||
end
|
||||
|
||||
|
@ -37,6 +37,8 @@ end
|
||||
A2 = randn(Float32,(4,1))
|
||||
@test tf(@net (x,y) -> cat(2,x,y))(A1,A2) ≈ cat(2,A1,A2)
|
||||
@test tf(@net x -> length(x))(A1) == length(A1)
|
||||
A = randn(Float32,(5,5))
|
||||
@test tf(@net x -> diag(x))(A) ≈ diag(A)
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user