From 849bf110b566e083f459088e4412cecefd4fd22d Mon Sep 17 00:00:00 2001 From: Mark Shields Date: Tue, 9 Nov 2021 09:58:08 -0800 Subject: [PATCH] [checkpoint] Revert emitter.py, must have run 'black .' by mistake. --- python/tvm/micro/contrib/stm32/emitter.py | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/python/tvm/micro/contrib/stm32/emitter.py b/python/tvm/micro/contrib/stm32/emitter.py index aec5912871fd..8453ea78e012 100644 --- a/python/tvm/micro/contrib/stm32/emitter.py +++ b/python/tvm/micro/contrib/stm32/emitter.py @@ -44,7 +44,7 @@ def _fix_name(node_name): - """Replace ':' with '_' in names like 'InputImg:0'""" + """ Replace ':' with '_' in names like 'InputImg:0' """ return node_name.replace(":", "_") @@ -116,7 +116,7 @@ def _get_tensor_size_bytes(dims, dltype): def _preprocess_code(src): - """Hack the C code implementing the model.""" + """ Hack the C code implementing the model. """ dst = "#include \n" "#include \n\n" dst = dst + src return dst @@ -193,7 +193,7 @@ def __init__(self, include_activations=True, include_inputs=True, include_output self._quantization = {} def _extract_quantization_info(self, quantization): - """Build dictionary with quantization infos.""" + """ Build dictionary with quantization infos.""" for dl_tensor_name in self._input_data: if dl_tensor_name in quantization: @@ -258,7 +258,7 @@ def _get_tensor_from_node(self, nid, idx): return tensor def _compute_data_placement(self): - """Compute inputs, outputs, weight, activation sizes""" + """ Compute inputs, outputs, weight, activation sizes""" self._inputs = self._arg_nodes.copy() @@ -548,7 +548,7 @@ def parse_module(self, module, quantization=None): self._parse_model(quantization) def _emit_params_data(self, name, out_h, out_c): - """Emits the network_data[c,h] files with parameters.""" + """ Emits the network_data[c,h] files with parameters.""" name_upper = name.upper() @@ -674,7 +674,7 @@ def _emit_open(self, name, out_h, out_c): ) def _emit_close(self, name, out_h, out_c): - """Emits the ai_model_info structure.""" + """ Emits the ai_model_info structure. """ name_upper = name.upper() @@ -794,7 +794,7 @@ def _emit_tensor_quant(self, dl_tensor_name, out_c): return None def _emit_tensor_init(self, dl_tensor_name, tensor, out_c): - """Emits the tensor instantiation code.""" + """ Emits the tensor instantiation code. """ dltype = tensor["dltype"] dims = tensor["dims"] @@ -838,7 +838,7 @@ def _emit_tensor_init(self, dl_tensor_name, tensor, out_c): def _emit_activation_buffers(self, name, out_c): # pylint: disable=unused-argument - """Emits activation tensors, including inputs/outputs.""" + """ Emits activation tensors, including inputs/outputs.""" out_c.write( textwrap.dedent( @@ -905,7 +905,7 @@ def _emit_activation_buffers(self, name, out_c): out_c.write(f"\n") def _emit_params_buffers(self, name, out_c): - """Emits all parameter tensors.""" + """ Emits all parameter tensors.""" out_c.write( textwrap.dedent( @@ -922,7 +922,7 @@ def _emit_params_buffers(self, name, out_c): out_c.write(f"\n") def _emit_network(self, name, out_c): - """Emits prototypes for the network operator functions.""" + """ Emits prototypes for the network operator functions.""" out_c.write( textwrap.dedent( @@ -967,7 +967,7 @@ def _emit_tensor_activation(self, dl_tensor_name, tensor, out_c): ) def _emit_activation_init(self, name, out_c): - """Emits buffer initialization code for activation tensors.""" + """ Emits buffer initialization code for activation tensors.""" out_c.write( textwrap.dedent( @@ -1015,7 +1015,7 @@ def _emit_activation_init(self, name, out_c): ) def _emit_params_init(self, name, out_c): - """Emits buffer initialization code for params tensors.""" + """ Emits buffer initialization code for params tensors.""" out_c.write( textwrap.dedent( @@ -1063,13 +1063,13 @@ def _emit_params_init(self, name, out_c): ) def _emit_init(self, name, out_c): - """Emits buffer initialization code.""" + """ Emits buffer initialization code.""" self._emit_activation_init(name, out_c) self._emit_params_init(name, out_c) def _emit_run(self, name, out_h, out_c): - """Emits the run function code.""" + """ Emits the run function code.""" out_h.write( textwrap.dedent( @@ -1230,7 +1230,7 @@ def _emit_run(self, name, out_h, out_c): out_c.write(f"\n") def _emit_create_destroy(self, name, out_h, out_c): - """Emits the create/destroy functions.""" + """ Emits the create/destroy functions.""" out_h.write( textwrap.dedent( @@ -1296,7 +1296,7 @@ def _emit_create_destroy(self, name, out_h, out_c): ) def emit_code(self, dest_dir, model_name): - """Emits the C code implementing the model.""" + """ Emits the C code implementing the model. """ # Build the directory structure if os.path.exists(dest_dir):