commit
72f13834f5
@ -61,6 +61,11 @@ for (M, f, arity) in DiffRules.diffrules()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Eliminating ambiguity
|
||||||
|
import Base:^
|
||||||
|
|
||||||
|
^(a::TrackedReal, b::Integer) = track(^, a, b)
|
||||||
|
|
||||||
# Tuples
|
# Tuples
|
||||||
|
|
||||||
struct TrackedTuple{T<:Tuple}
|
struct TrackedTuple{T<:Tuple}
|
||||||
|
@ -75,6 +75,8 @@ end
|
|||||||
|
|
||||||
@test (param([1,2,3]) .< 2) == [true, false, false]
|
@test (param([1,2,3]) .< 2) == [true, false, false]
|
||||||
|
|
||||||
|
@test param(2)^2 == 4.0
|
||||||
|
|
||||||
@testset "Intermediates" begin
|
@testset "Intermediates" begin
|
||||||
x = param([1])
|
x = param([1])
|
||||||
l = sum((x .+ x).^2)
|
l = sum((x .+ x).^2)
|
||||||
|
Loading…
Reference in New Issue
Block a user