MCPcopy Create free account
hub / github.com/pytorch/executorch / test_to_bytes

Method test_to_bytes

exir/_serialize/test/test_program.py:1136–1143  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1134
1135class TestExtendedHeader(unittest.TestCase):
1136 def test_to_bytes(self) -> None:
1137 eh = _ExtendedHeader(
1138 program_size=EXAMPLE_PROGRAM_SIZE,
1139 segment_base_offset=EXAMPLE_SEGMENT_BASE_OFFSET,
1140 segment_data_size=EXAMPLE_SEGMENT_DATA_SIZE,
1141 )
1142 self.assertTrue(eh.is_valid())
1143 self.assertEqual(eh.to_bytes(), EXAMPLE_HEADER_DATA[0:32])
1144
1145 def test_to_bytes_with_non_defaults(self) -> None:
1146 eh = _ExtendedHeader(

Callers

nothing calls this directly

Calls 3

_ExtendedHeaderClass · 0.90
is_validMethod · 0.45
to_bytesMethod · 0.45

Tested by

no test coverage detected