add length

This commit is contained in:
Ali Hamdi 2017-06-09 12:13:30 +02:00
parent 74b36b0094
commit 6b4db60f05
2 changed files with 2 additions and 1 deletions

View File

@ -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)
inv, det, transpose, permutedims, cat, length)
@eval graph(::typeof($op), args...) = $op(args...)
end

View File

@ -36,6 +36,7 @@ end
A1 = randn(Float32,(4,1))
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)
end
end