class_docstr: Code emitter class.
class_docstr_tok: ["Code","emitter","class","."]
docstr: Emits the network.h file with a few network defines and
  writes the header part of the network.c file.
docstr_tok: ["Emits","the","network.h","file","with","a","few","network","defines","and","writes","the","header","part","of","the","network.c","file","."]
code: def _emit_open(self, name, out_h, out_c):
      """Emits the network.h file with a few network defines and
      writes the header part of the network.c file."""
  
      name_upper = name.upper()
  
      input_size = len(self._input_data)
      output_size = len(self._output_data)
  
      # XXX.h
  
      out_h.write(
          textwrap.dedent(
              f"""\
          #ifndef __AI_{name_upper}_H__
          #define __AI_{name_upper}_H__
  
          #include \"ai_runtime_api.h\"
  
          #define _{name_upper}_INPUTS_COUNT_ ({input_size})
          #define _{name_upper}_OUTPUTS_COUNT_ ({output_size})
          #define _{name_upper}_ACTIVATION_BYTES_ ({self._activations_size})
          """
          )
      )
  
      # XXX.c
  
      out_c.write(
          textwrap.dedent(
              f"""\
          #include <stdio.h>
  
          #include \"dlpack/dlpack.h\"
          #include \"tvm/runtime/c_runtime_api.h\"
          #include \"{name}.h\"
          #include \"{name}_data.h\"
          """
          )
      )
  
imports: import contextlib
  import json
  import os
  import re
  import shutil
  import tarfile
  import textwrap
  from datetime import datetime
  import numpy
  import tvm
  from tvm.contrib import utils
label_desc: Use image node_id 11 for calling the CodeEmitter obj's underlying member method code with example usage: obj._emit_open(name, out_h, out_c) without return types