Skip to content

Commit

Permalink
test(compression): remove the test log hexdump of the Python metadata (
Browse files Browse the repository at this point in the history
…#2941)

Remove the hexdump of the compression metadata to the test log
during the Python compression metadata test, and the requirement
for the hexdump Python package. This dump was helpful during
development of the compression metadata flatbuffer schema to
assess how changes were represented, affecting the size and the
scaling of the size.

Unfortunately, requiring the hexdump module creates problems when
Google imports this code internally, so remove it for now.

The C++ metadata test still prints a hexdump; however, the C++
flatbuffer library writes the flatbuffer slightly differently.
Within the bounds of the flatbuffer specifications, different
library writers can make different, compatible implementation
choices.

BUG=see description
  • Loading branch information
rkuester authored Nov 27, 2024
1 parent 233e936 commit e2cc052
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion tensorflow/lite/micro/compression/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ py_test(
deps = [
"metadata_py",
"@flatbuffers//:runtime_py",
requirement("hexdump"),
requirement("tensorflow"),
],
)
Expand Down
7 changes: 3 additions & 4 deletions tensorflow/lite/micro/compression/metadata_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"""

from dataclasses import dataclass
import hexdump
import flatbuffers
import tensorflow as tf

Expand Down Expand Up @@ -102,9 +101,9 @@ def testSchemaVersion(self):

self.assertEqual(metadata.schemaVersion, _EXPECTED_SCHEMA_VERSION)

def testPrintFlatbuffer(self):
# Print a representation of the binary flatbuffer for debugging purposes.
print(hexdump.hexdump(self.flatbuffer, result='return'))
def testPrintFlatbufferLen(self):
"""Print the flatbuffer length for the log.
"""
print(f"length: {len(self.flatbuffer)}")


Expand Down
1 change: 0 additions & 1 deletion third_party/python_requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# it is run.

bitarray
hexdump
tensorflow
twine
numpy
Expand Down
3 changes: 0 additions & 3 deletions third_party/python_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,6 @@ h5py==3.12.1 \
# via
# keras
# tensorflow
hexdump==3.3 \
--hash=sha256:d781a43b0c16ace3f9366aade73e8ad3a7bd5137d58f0b45ab2d3f54876f20db
# via -r third_party/python_requirements.in
idna==3.10 \
--hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \
--hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3
Expand Down

0 comments on commit e2cc052

Please sign in to comment.