From 0655c1cc43108c741a77e775b2a4ef46984829ce Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 26 Oct 2023 16:15:35 +0100 Subject: MLIA-1019 Fix rebase artifact Fixed an artifact that crept in during the upstream rebase process, change a6ae703b6e41c73 was being taken out, but 3cd84481fa25 reintroduced the first part of a try/except block which caused a syntax error. Change-Id: I7fc2e18a227a30ebaaee0763450ee68646611add Signed-off-by: Benjamin Klimczak --- src/mlia/nn/rewrite/core/utils/numpy_tfrecord.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mlia/nn/rewrite/core/utils/numpy_tfrecord.py b/src/mlia/nn/rewrite/core/utils/numpy_tfrecord.py index 38ac1ed..0d2608b 100644 --- a/src/mlia/nn/rewrite/core/utils/numpy_tfrecord.py +++ b/src/mlia/nn/rewrite/core/utils/numpy_tfrecord.py @@ -30,12 +30,11 @@ def decode_fn(record_bytes: Any, type_map: dict) -> dict: return features -def make_decode_fn(filename: str, model_filename: str | Path | None = None) -> Callable: +def make_decode_fn(filename: str) -> Callable: """Make decode filename.""" meta_filename = filename + ".meta" - try: - with open(meta_filename, encoding="utf-8") as file: - type_map = json.load(file)["type_map"] + with open(meta_filename, encoding="utf-8") as file: + type_map = json.load(file)["type_map"] return lambda record_bytes: decode_fn(record_bytes, type_map) -- cgit v1.2.1