diff --git a/ivy/functional/frontends/tensorflow/nn.py b/ivy/functional/frontends/tensorflow/nn.py index 410dfe0d2e65b..fa1dca5d1b21b 100644 --- a/ivy/functional/frontends/tensorflow/nn.py +++ b/ivy/functional/frontends/tensorflow/nn.py @@ -91,7 +91,9 @@ def avg_pool1d(input, ksize, strides, padding, data_format="NWC", name=None): # avg_pool2d @to_ivy_arrays_and_back def avg_pool2d(input, ksize, strides, padding, data_format="NHWC", name=None): - return ivy.avg_pool2d(input, ksize, strides, padding, data_format=data_format) + return ivy.avg_pool2d( + input, ksize, strides, padding, data_format=data_format + ).astype(input.dtype) # avg_pool3d diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_nn.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_nn.py index d317cf5d90ca5..dfb623752ca33 100644 --- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_nn.py +++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_nn.py @@ -704,6 +704,8 @@ def test_tensorflow_avg_pool2d( ksize=ksize, strides=strides, padding=padding, + rtol=1e-2, + atol=1e-2, )