From 3855dcd40fe926a00b98f16cf38bbc43004abdc4 Mon Sep 17 00:00:00 2001 From: Peter Hawkins Date: Fri, 12 Jul 2024 08:44:51 -0700 Subject: [PATCH] [scipy] Use NumPy functions rather than their deprecated aliases in SciPy's namespace. SciPy 1.12.0 removes a number of functions from the scipy namespace that were reexports of NumPy APIs: https://docs.scipy.org/doc/scipy/release/1.12.0-notes.html#expired-deprecations This change updates users to use the NumPy names instead. PiperOrigin-RevId: 651786100 --- trax/data/tf_inputs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trax/data/tf_inputs.py b/trax/data/tf_inputs.py index 52090d375..38670d9c4 100644 --- a/trax/data/tf_inputs.py +++ b/trax/data/tf_inputs.py @@ -1766,7 +1766,7 @@ def compute_single_result(op_name, num_args): elif op_name == 'gain_percent': return 100 + num_args[0] elif op_name == 'gcd': - return scipy.gcd(int(num_args[0]), int(num_args[1])) + return np.gcd(int(num_args[0]), int(num_args[1])) elif op_name == 'inverse': if num_args[0] != 0: return 1 / num_args[0] @@ -1961,7 +1961,7 @@ def single_op_to_python_command(op_name, num_args): elif op_name == 'gain_percent': return '100 + {}'.format(num_args[0]) elif op_name == 'gcd': - return 'scipy.gcd(int({}), int({}))'.format(num_args[0], num_args[1]) + return 'np.gcd(int({}), int({}))'.format(num_args[0], num_args[1]) elif op_name == 'inverse': # safe inverse if num_args[0] != 0: