Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions desc/objectives/objective_funs.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,17 @@ def build(self, use_jit=None, verbose=1):
else:
self._deriv_mode = "blocked"

warnif(
any((obj._deriv_mode == "rev") for obj in self.objectives)
and self._deriv_mode == "batched",
UserWarning,
"Using batched derivative mode, which performs fwd mode "
"differentiation of the entire objective, but one or more of the"
' sub-objectives have deriv_mode="rev". It is recommended to use '
'deriv_mode="blocked", as these objective performances may suffer '
"in fwd mode, or may not even support reverse mode at all.",
Comment thread
YigitElma marked this conversation as resolved.
Outdated
)

errorif(
isposint(self._jac_chunk_size) and self._deriv_mode in ["blocked"],
ValueError,
Expand Down
Loading