Skip to content

Commit

Permalink
Shorter solution
Browse files Browse the repository at this point in the history
  • Loading branch information
adrhill committed Sep 5, 2024
1 parent e18fab5 commit ad0eca5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/adtypes_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,8 @@ end

## Pretty printing
for detector in (:TracerSparsityDetector, :TracerLocalSparsityDetector)
@eval function Base.show(
io::IO, d::$detector{TG,TH}; indent=0
) where {PG,TG<:GradientTracer{PG},PH,TH<:HessianTracer{PH}}
if PG == DEFAULT_GRADIENT_PATTERN && PH == DEFAULT_HESSIAN_PATTERN
@eval function Base.show(io::IO, d::$detector{TG,TH}) where {TG,TH}
if TG == DEFAULT_GRADIENT_TRACER && TH == DEFAULT_HESSIAN_TRACER
println(io, $detector, "()")
else
println(io, $detector, "{", TG, ",", TH, "}()")
Expand Down

0 comments on commit ad0eca5

Please sign in to comment.