Beispiel #1
0
 def execute(self):
     if FuncInfo.params.output:
         output_ext = os.path.splitext(FuncInfo.params.output)[1].lower()
         if output_ext == '.yaml':
             cvt.func_set_export_yaml(self._func_dict,
                                      FuncInfo.params.output)
         else:
             with open(FuncInfo.params.output, 'w') as f:
                 f.write('\n'.join(list(self._func_set)))
     else:
         sys.stdout.write('\n'.join(list(self._func_set)))
         sys.stdout.write('\n')
Beispiel #2
0
 def execute(self):
     if FuncInfo.params.output:
         output_ext = os.path.splitext(FuncInfo.params.output)[1].lower()
         if output_ext == '.yaml':
             cvt.func_set_export_yaml(self._func_dict,
                                      FuncInfo.params.output)
         else:
             with open(FuncInfo.params.output, 'w') as f:
                 f.write('\n'.join(list(self._func_set)))
     else:
         sys.stdout.write(
             "nnabla-c-runtime currently support the following functions in model:\n"
         )
         sys.stdout.write('\n'.join(list(self._func_set)))
         sys.stdout.write('\n')
     if len(self._nonsupport_set):
         sys.stderr.write(
             "nnabla-c-runtime currently does not support the following functions in model:\n"
         )
         sys.stderr.write('\n'.join(list(self._nonsupport_set)))
         sys.stderr.write('\n')
Beispiel #3
0
 def execute(self):
     if FuncInfo.params.api != 0:
         api_info = cvt.get_api_level_info()
         api_info.set_api_level(FuncInfo.params.api)
         # query current api level
         print("API_LEVEL: {}".format(api_info.get_current_level()))
         if FuncInfo.params.api == -1:
             return
         for func in api_info.get_function_list():
             print(api_info.get_func_uniq_name(func))
         return
     if FuncInfo.params.output:
         output_ext = os.path.splitext(FuncInfo.params.output)[1].lower()
         if output_ext == '.yaml':
             cvt.func_set_export_yaml(self._func_dict,
                                      FuncInfo.params.output)
         else:
             with open(FuncInfo.params.output, 'w') as f:
                 f.write('\n'.join(list(self._func_set)))
     else:
         sys.stdout.write('\n'.join(list(self._func_set)))
         sys.stdout.write('\n')