File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed
Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
55Compat = " 34da2185-b29b-5c13-b0c7-acf172513d20"
66DifferentiationInterface = " a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
77DispatchDoctor = " 8d63f2c5-f18a-4cf2-ba9d-b3f60fc568c8"
8+ DynamicExpressions = " a40a106e-89c9-4ca8-8020-a735e8728b6b"
89ForwardDiff = " f6369f11-7733-5829-9624-2563aa707210"
910Interfaces = " 85a1e053-f937-4924-92a5-1367d23b7b87"
1011JET = " c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
@@ -26,6 +27,7 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2627
2728[compat ]
2829Aqua = " 0.7"
30+ JET = " 0.11"
2931
3032[preferences .DynamicExpressions ]
3133dispatch_doctor_codegen_level = " min"
Original file line number Diff line number Diff line change @@ -23,26 +23,27 @@ if "jet" in test_name
2323 )
2424 using JET
2525 using DynamicExpressions
26- struct MyIgnoredModule
26+
27+ # JET v0.11 uses the ReportMatcher + match_report API.
28+ struct MyIgnoredModule <: JET.ReportMatcher
2729 mod:: Module
2830 end
29- function JET. match_module (
30- mod :: MyIgnoredModule , @nospecialize (report:: JET.InferenceErrorReport )
31+ function JET. match_report (
32+ m :: MyIgnoredModule , @nospecialize (report:: JET.InferenceErrorReport )
3133 )
32- s_mod = string (mod . mod)
34+ s_mod = string (m . mod)
3335 any (report. vst) do vst
3436 occursin (s_mod, string (JET. linfomod (vst. linfo)))
3537 end
3638 end
39+
3740 JET. test_package (
3841 DynamicExpressions;
39- target_defined_modules = true ,
42+ target_modules = (DynamicExpressions,) ,
4043 ignored_modules= (
4144 MyIgnoredModule (DynamicExpressions. NonDifferentiableDeclarationsModule),
4245 ),
4346 )
44- # TODO : Hack to get JET to ignore modules
45- # https://github.com/aviatesk/JET.jl/issues/570#issuecomment-2199167755
4647 end
4748end
4849if " main" in test_name
Original file line number Diff line number Diff line change 8383end
8484
8585# Operator that is NaN for forward pass
86- bad_op (x) = x > 0.0 ? log (x) : convert (typeof (x), NaN )
86+ # Define only for numeric types; `@extend_operators` adds the `Node` method.
87+ bad_op (x:: Real ) = x > 0.0 ? log (x) : convert (typeof (x), NaN )
8788# And operator that is undefined for backward pass
88- undefined_grad_op (x) = x >= 0.0 ? x : zero (x)
89+ undefined_grad_op (x:: Real ) = x >= 0.0 ? x : zero (x)
8990# And operator that gives a NaN for backward pass
9091bad_grad_op (x) = x
9192
You can’t perform that action at this time.
0 commit comments