Merge pull request #204 from boathit/master

eliminate ambiguous
This commit is contained in:
Mike J Innes 2018-03-14 15:34:41 +00:00 committed by GitHub
commit 72f13834f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -61,6 +61,11 @@ for (M, f, arity) in DiffRules.diffrules()
end
end
# Eliminating ambiguity
import Base:^
^(a::TrackedReal, b::Integer) = track(^, a, b)
# Tuples
struct TrackedTuple{T<:Tuple}

View File

@ -75,6 +75,8 @@ end
@test (param([1,2,3]) .< 2) == [true, false, false]
@test param(2)^2 == 4.0
@testset "Intermediates" begin
x = param([1])
l = sum((x .+ x).^2)