parameters: (self, model_path, inputs=None, outputs=None)
return_statement: return self
docstring: Load model and find input/outputs from the model file.
docstring_summary: Load model and find input/outputs from the model file.
docstring_tokens: Load model and find input / outputs from the model file .
function: def load(self, model_path, inputs=None, outputs=None):
          """Load model and find input/outputs from the model file."""
          opt = rt.SessionOptions()
          # enable level 3 optimizations
          # FIXME: enable below once onnxruntime 0.5 is released
          # opt.set_graph_optimization_level(3)
          self.sess = rt.InferenceSession(model_path, opt)
          # get input and output names
          if not inputs:
              self.inputs = [meta.name for meta in self.sess.get_inputs()]
          else:
              self.inputs = inputs
          if not outputs:
              self.outputs = [meta.name for meta in self.sess.get_outputs()]
          else:
              self.outputs = outputs
          return self
function_tokens: def load ( self , model_path , inputs = None , outputs = None ) : opt = rt . SessionOptions ( ) # enable level 3 optimizations # FIXME: enable below once onnxruntime 0.5 is released # opt.set_graph_optimization_level(3) self . sess = rt . InferenceSession ( model_path , opt ) # get input and output names if not inputs : self . inputs = [ meta . name for meta in self . sess . get_inputs ( ) ] else : self . inputs = inputs if not outputs : self . outputs = [ meta . name for meta in self . sess . get_outputs ( ) ] else : self . outputs = outputs return self