From 995a320700c7172968c853f39c62f20266296219 Mon Sep 17 00:00:00 2001 From: Vesselin Grantcharov Date: Sun, 31 Jul 2022 01:46:38 -0400 Subject: [PATCH] Update levenberg_marquardt.py Retracing can be avoided by simply adding the tf.function decorator sample showing the effect of the change on runtime and warning that is mentioned without decorator: https://gist.github.com/Vesalon/a643c355d3caa2bf30f6ecf485505276 --- tensorflow_graphics/math/optimizer/levenberg_marquardt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow_graphics/math/optimizer/levenberg_marquardt.py b/tensorflow_graphics/math/optimizer/levenberg_marquardt.py index 71cd5ed8e..cd0b8ff6e 100644 --- a/tensorflow_graphics/math/optimizer/levenberg_marquardt.py +++ b/tensorflow_graphics/math/optimizer/levenberg_marquardt.py @@ -78,7 +78,7 @@ def _compute_jacobian(values, variables, tape): values = tf.expand_dims(values, axis=-1) return values, jacobian - +@tf.function def minimize(residuals, variables, max_iterations,