Lines Matching +full:- +full:- +full:header
1 # SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates <open-source-office@arm.…
3 # SPDX-License-Identifier: Apache-2.0
9 # www.apache.org/licenses/LICENSE-2.0
156 header = get_header(params["tflite_generator"], params["interpreter"])
167 write_config(fpaths["config_data"], config_params, params["name"], fpaths["test_data"], header)
174 … write_c_array(tensor, fpaths[name], dtype, params["name"], name, fpaths["test_data"], header)
203 """ Convert a model generated with keras to tflite-format """
287 def write_config(config_fpath, params, prefix, test_data_fpath, header): argument
290 f.write(header)
310 f.write(header)
314 def write_c_array(data, fname, dtype, prefix, tensor_name, test_data_fpath, header): argument
328 f.write(header)
338 for i in range(len(data) - 1):
339 if i % data_shape[-1] == 0:
343 if len(data) - 1 % data_shape[-1] == 0:
345 f.write(f"{data[len(data) - 1]: {format_width}n}" + "\n};\n")
363 CLANG_FORMAT = 'clang-format-12 -i' # For formatting generated headers.
388 """ Convert a model in json-format to tflite-format"""
418 # Tensors are stored byte-wise in schema
423 for byte in weights_in_bytes[:-1]:
425 output.write(f" {weights_in_bytes[-1]}\n")
434 command = f"flatc -o {json_output_fpath.parent} -c -b {schema_path} {json_output_fpath}"
452 header = f"// Generated by {os.path.basename(sys.argv[0])}"
454 … header += f" using tensorflow version {tf.__version__} (Keras version {keras.__version__}).\n"
456 command = "flatc --version"
469 header += f" using {str(flatc_version)[2:-3]}\n"
476 header += f"// Interpreter from tensorflow version {version} and revision {revision}.\n"
482 header += f"// Interpreter from tflite_runtime version {version} and revision {revision}.\n"
485 header += f"// Interpreter from tflite_micro runtime version {version}.\n"
489 return header