Sha256: 4eee263c4cfad16c2fb9632732ecc12a3511f04459a3fde6333a65e771d06d98
Contents?: true
Size: 638 Bytes
Versions: 87
Compression:
Stored size: 638 Bytes
Contents
module OnnxRuntime class Model def initialize(path_or_bytes, **session_options) @session = InferenceSession.new(path_or_bytes, **session_options) end def predict(input_feed, output_names: nil, **run_options) predictions = @session.run(output_names, input_feed, **run_options) output_names ||= outputs.map { |o| o[:name] } result = {} output_names.zip(predictions).each do |k, v| result[k.to_s] = v end result end def inputs @session.inputs end def outputs @session.outputs end def metadata @session.modelmeta end end end
Version data entries
87 entries across 87 versions & 1 rubygems