Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ops/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ function Base.round(::Type{T}, value::AbstractTensor) where T
end


-(n::AbstractTensor) = negative(n)
@op function -(n::AbstractTensor; kwargs...)
negative(n; kwargs...)
end

@op function Base.complex(x_r::AbstractTensor, x_i::AbstractTensor; kwargs...)
Ops.complex(x_r, x_i; kwargs...)
Expand Down
6 changes: 5 additions & 1 deletion test/meta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ end
end
end


@testset "Negating and @tf" begin
a = constant(1)
@tf b = -a
@test true # Above line would have errored if unary - didn't work with @tf
end

@testset "Naming Big Demo" begin
let
Expand Down