File tree 2 files changed +9
-9
lines changed 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -35,13 +35,6 @@ function Base.empty!(cache::InputCache)
35
35
return
36
36
end
37
37
38
- function Base. isempty (cache:: InputCache )
39
- return isempty (cache. dx) &&
40
- isempty (cache. scalar_constraints) &&
41
- isempty (cache. vector_constraints) &&
42
- cache. objective === nothing
43
- end
44
-
45
38
"""
46
39
reverse_differentiate!(model::MOI.ModelLike)
47
40
Original file line number Diff line number Diff line change @@ -671,6 +671,13 @@ function test_diff_errors()
671
671
return
672
672
end
673
673
674
+ function is_empty (cache:: DiffOpt.InputCache )
675
+ return isempty (cache. dx) &&
676
+ isempty (cache. scalar_constraints) &&
677
+ isempty (cache. vector_constraints) &&
678
+ cache. objective === nothing
679
+ end
680
+
674
681
# Credit to @klamike
675
682
function test_empty_cache ()
676
683
m = Model (
@@ -690,10 +697,10 @@ function test_empty_cache()
690
697
691
698
function get_sensitivity (m, xᵢ, pᵢ)
692
699
DiffOpt. empty_input_sensitivities! (m)
693
- @test DiffOpt . isempty (unsafe_backend (m). optimizer. input_cache)
700
+ @test is_empty (unsafe_backend (m). optimizer. input_cache)
694
701
if ! isnothing (unsafe_backend (m). optimizer. diff) &&
695
702
! isnothing (unsafe_backend (m). optimizer. diff. model. input_cache)
696
- @test DiffOpt . isempty (
703
+ @test is_empty (
697
704
unsafe_backend (m). optimizer. diff. model. input_cache,
698
705
)
699
706
end
You can’t perform that action at this time.
0 commit comments