Skip to content

Commit

Permalink
Increase-test-coverage in backend_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Faisal-Alsrheed committed Sep 21, 2023
1 parent 2966a63 commit 00b0d3d
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions keras_core/backend/common/backend_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ def test_same_padding_without_output_padding(self):
self.assertEqual(left_pad, 2)
self.assertEqual(right_pad, 1)

def test_invalid_padding_type(self):
"""Test with an invalid padding type."""
with self.assertRaises(AssertionError):
_convert_conv_tranpose_padding_args_from_keras_to_jax(
kernel_size=3,
stride=2,
dilation_rate=1,
padding="unknown",
output_padding=None,
)


class ConvertConvTransposePaddingArgsTorchTest(test_case.TestCase):
def test_valid_padding_without_output_padding(self):
Expand Down Expand Up @@ -90,17 +79,6 @@ def test_same_padding_without_output_padding(self):
self.assertEqual(torch_padding, 1)
self.assertEqual(torch_output_padding, 1)

def test_invalid_padding_type(self):
"""Test with an invalid padding type"""
with self.assertRaises(AssertionError):
_convert_conv_tranpose_padding_args_from_keras_to_torch(
kernel_size=3,
stride=2,
dilation_rate=1,
padding="unknown",
output_padding=None,
)


class ComputeConvTransposePaddingArgsForJAXTest(test_case.TestCase):
def test_valid_padding_without_output_padding(self):
Expand Down Expand Up @@ -162,17 +140,6 @@ def test_same_padding_without_output_padding(self):
self.assertEqual(torch_paddings, [1, 1])
self.assertEqual(torch_output_paddings, [1, 1])

def test_invalid_padding_raises_assertion_error(self):
"""providing an invalid padding type raises an AssertionError."""
with self.assertRaises(AssertionError):
_convert_conv_tranpose_padding_args_from_keras_to_torch(
kernel_size=3,
stride=2,
dilation_rate=1,
padding="invalid_padding",
output_padding=None,
)

def test_valid_padding_with_none_output_padding(self):
"""Test conversion with 'valid' padding and no output padding"""
(
Expand Down

0 comments on commit 00b0d3d

Please sign in to comment.