Skip to content

Commit 9adbbfe

Browse files
Update system.jl
1 parent 3c64be5 commit 9adbbfe

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

lib/ModelingToolkitBase/src/systems/system.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,14 +1503,6 @@ function Base.showerror(io::IO, err::EventsInTimeIndependentSystemError)
15031503
end
15041504

15051505
function supports_initialization(sys::System)
1506-
# Use `get_jumps` rather than the flattened `jumps`. The two are
1507-
# equivalent here because the `isempty(get_systems(sys))` short-circuit
1508-
# before this term guarantees the subsystem-flattening branch in
1509-
# `jumps(sys)` (which does `copy` + `append!`) is unreachable. The
1510-
# mutation in that unreachable branch nevertheless prevents Enzyme from
1511-
# proving `sys` is read-only, blocking `Enzyme.gradient` through any
1512-
# closure that ends up at `_late_binding_update_u0_p_impl` — including
1513-
# `remake(prob; p = repack(tunables))` on MTK-generated problems.
15141506
return isempty(get_systems(sys)) && isempty(get_jumps(sys)) &&
15151507
isempty(get_costs(sys)) && isempty(get_constraints(sys))
15161508
end

0 commit comments

Comments
 (0)