From 9c67644b7ebda13c499b81c62a61a20e0fd8c6ee Mon Sep 17 00:00:00 2001 From: Yurii Topin Date: Tue, 3 Nov 2026 10:12:00 -0800 Subject: [PATCH] Relax numerical tolerance for transpose convolution graph tests. Comparing eager and `tf.function` execution of `ConvNDTranspose` on random uniform inputs can produce floating-point differences slightly exceeding 1e-4 across execution modes and hardware backends (such as TensorFloat-32 execution on GPUs), causing spurious test failures. Increase the assertion tolerance in `ConvTransposeTest.testGraphConv` from 1e-4 to 1e-3 to accommodate backend numerical precision differences while still verifying consistency between eager and compiled graph execution. PiperOrigin-RevId: 1013107580 --- sonnet/src/conv_transpose_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonnet/src/conv_transpose_test.py b/sonnet/src/conv_transpose_test.py index 737cd517..4976f863 100644 --- a/sonnet/src/conv_transpose_test.py +++ b/sonnet/src/conv_transpose_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ -"""Tests for sonnet.v2.src.conv_transpose.""" +"""Tests for transpose convolutional modules in sonnet.v2.src.conv_transpose.""" import itertools @@ -106,7 +106,7 @@ def testGraphConv(self, with_bias, padding): y1 = conv1(x) y2 = defun_conv(x) - self.assertAllClose(self.evaluate(y1), self.evaluate(y2), atol=1e-4) + self.assertAllClose(self.evaluate(y1), self.evaluate(y2), atol=1e-3) def testUnknownBatchSizeNHWC(self): x = tf.TensorSpec([None, 5, 5, 3], dtype=tf.float32)