Skip to content

fix left-padding #2278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update test
  • Loading branch information
pass-lin committed May 20, 2025
commit f1c55ac5fcfec834875b38b94c465f792294a469
10 changes: 5 additions & 5 deletions keras_hub/src/layers/preprocessing/start_end_packer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_start_end_padding_value(self):
expected_output = [[3, 3, 1, 5, 6, 7, 2], [3, 1, 8, 9, 10, 11, 2]]
self.assertAllEqual(output, expected_output)

def test_truncation_side_flips(self):
def test_truncation(self):
# right padding
input_data = list(range(10))
packer = StartEndPacker(
Expand All @@ -142,7 +142,7 @@ def test_truncation_side_flips(self):
)
self.assertAllEqual(packer(input_data), expected_output)

def test_truncation_side_flips_wo_endvalue(self):
def test_truncation_wo_endvalue(self):
# right padding
input_data = list(range(10))
packer = StartEndPacker(
Expand Down Expand Up @@ -289,7 +289,8 @@ def test_get_config(self):

self.assertEqual(config, {**config, **expected_config_subset})

def test_return_padding_mask_right_padding(self):
def test_return_padding_mask(self):
# right_padding
input_data = [[5, 6, 7], [8, 9, 10, 11]]
start_end_packer = StartEndPacker(
sequence_length=6,
Expand All @@ -307,8 +308,7 @@ def test_return_padding_mask_right_padding(self):
self.assertAllEqual(output, expected_output)
self.assertAllEqual(padding_mask, expected_padding_mask)

def test_return_padding_mask_left_padding(self):
input_data = [[5, 6, 7], [8, 9, 10, 11]]
# left_padding
start_end_packer = StartEndPacker(
sequence_length=6,
start_value=1,
Expand Down
Loading