add size
This commit is contained in:
parent
697a300ec3
commit
7559196ab9
@ -28,6 +28,8 @@ graph(::typeof(all), x, dim=nothing) = TensorFlow.reduce_all(x;axis=dim)
|
|||||||
graph(::typeof(any), x, dim=nothing) = TensorFlow.reduce_any(x;axis=dim)
|
graph(::typeof(any), x, dim=nothing) = TensorFlow.reduce_any(x;axis=dim)
|
||||||
graph(::typeof(mean), x, dim=nothing) = TensorFlow.reduce_mean(x;axis=dim)
|
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) = TensorFlow.size(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,
|
||||||
|
@ -41,6 +41,9 @@ end
|
|||||||
@test tf(@net x -> diag(x))(A) ≈ diag(A)
|
@test tf(@net x -> diag(x))(A) ≈ diag(A)
|
||||||
A = randn(Float32,(5,))
|
A = randn(Float32,(5,))
|
||||||
@test tf(@net x -> diagm(x))(A) ≈ diagm(A)
|
@test tf(@net x -> diagm(x))(A) ≈ diagm(A)
|
||||||
|
A = randn(4,5)
|
||||||
|
@test tf(@net x -> size(x))(A) == [4,5]
|
||||||
|
@test tf(@net (x,y) -> size(x,y))(A,1) == 4
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user