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

Function _expected_int48_bytes

backends/arm/test/misc/test_process_node.py:64–69  ·  view source on GitHub ↗
(values: torch.Tensor)

Source from the content-addressed store, hash-verified

62
63
64def _expected_int48_bytes(values: torch.Tensor) -> list[int]:
65 packed: list[int] = []
66 for value in values.tolist():
67 masked = int(value) & ((1 << 48) - 1)
68 packed.extend([(masked >> (8 * i)) & 0xFF for i in range(6)])
69 return packed
70
71
72def test_process_placeholder_int48_normalizes_int32_const_values() -> None:

Calls

no outgoing calls

Tested by

no test coverage detected