Skip to content

Commit

Permalink
skip testLinSpace and testLogSpace if numpy 2.0 is used
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 665605785
  • Loading branch information
trax-robot authored and copybara-github committed Aug 21, 2024
1 parent 0d91963 commit 0a49187
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions trax/tf_numpy/numpy_impl/tests/math_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

"""Tests for tf numpy mathematical methods."""
import itertools
import unittest
from absl.testing import parameterized
import numpy as np
from six.moves import range
Expand Down Expand Up @@ -262,6 +263,8 @@ def run_test(arr, *args, **kwargs):
run_test([[1, 2], [3, 4]], axis=-1)
run_test([[1, 2], [3, 4]], axis=-2)

@unittest.skipIf(np.__version__ >= np.lib.NumpyVersion('2.0.0'),
'tf numpy is implemented to be numpy 1.x compatible')
def testLinSpace(self):
array_transforms = [
lambda x: x, # Identity,
Expand Down Expand Up @@ -291,6 +294,8 @@ def run_test(start, stop, **kwargs):
run_test(0, -1, num=10)
run_test(0, -1, endpoint=False)

@unittest.skipIf(np.__version__ >= np.lib.NumpyVersion('2.0.0'),
'tf numpy is implemented to be numpy 1.x compatible')
def testLogSpace(self):
array_transforms = [
lambda x: x, # Identity,
Expand Down

0 comments on commit 0a49187

Please sign in to comment.