Skip to content

Commit

Permalink
Update BfgsTest and LBfgsTest to work with tf.function layering effor…
Browse files Browse the repository at this point in the history
…ts by removing wrapping from val_and_grad.

PiperOrigin-RevId: 498781838
  • Loading branch information
ujaved authored and tensorflower-gardener committed Dec 31, 2022
1 parent 517027b commit 5ce266f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions tensorflow_probability/python/optimizer/bfgs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# ============================================================================
"""Tests for the unconstrained BFGS optimizer."""

import functools

from absl.testing import parameterized
import numpy as np
from scipy.stats import special_ortho_group
Expand All @@ -30,7 +28,6 @@


def _make_val_and_grad_fn(value_fn):
@functools.wraps(value_fn)
def val_and_grad(x):
return gradient.value_and_gradient(value_fn, x)
return val_and_grad
Expand Down
3 changes: 0 additions & 3 deletions tensorflow_probability/python/optimizer/lbfgs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# ============================================================================
"""Tests for the unconstrained L-BFGS optimizer."""

import functools

from absl.testing import parameterized
import numpy as np
from scipy.stats import special_ortho_group
Expand All @@ -30,7 +28,6 @@


def _make_val_and_grad_fn(value_fn):
@functools.wraps(value_fn)
def val_and_grad(x):
return gradient.value_and_gradient(value_fn, x)
return val_and_grad
Expand Down

0 comments on commit 5ce266f

Please sign in to comment.