Skip to content

Commit

Permalink
fix data modification for tensorflow compiled mode
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsKue committed Jun 18, 2024
1 parent c8060fc commit 27f99cd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def evaluate(self, *args, **kwargs):

# noinspection PyMethodOverriding
def compute_metrics(self, data: dict[str, Tensor], stage: str = "training") -> dict[str, Tensor]:
# compiled modes do not allow in-place operations on the data object
# we perform a shallow copy here, which is cheap
data = data.copy()

if self.summary_network is None:
data["inference_variables"] = self.configurator.configure_inference_variables(data)
data["inference_conditions"] = self.configurator.configure_inference_conditions(data)
Expand Down

0 comments on commit 27f99cd

Please sign in to comment.