Sha256: cc6cd0a35bd78829c944d21388cc9b8569d5d7b606bee6d374de15b652226799

Contents?: true

Size: 457 Bytes

Versions: 2

Compression:

Stored size: 457 Bytes

Contents

require 'chainer'
require "onnx-chainer/version"
require "onnx-chainer/graph"

org_verbose = $VERBOSE
$VERBOSE = nil
require "onnx-chainer/proto/onnx_pb"
$VERBOSE = org_verbose

module OnnxChainer
  class Error < StandardError; end

  def self.parse_file(onnx_path)
    raise "File not found. #{onnx_path}" if onnx_path.nil? || !File.exists?(onnx_path)

    m = Onnx::ModelProto.decode(File.read(onnx_path))

    OnnxChainer::Graph.parse(m.graph)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
onnx-red-chainer-0.1.2 lib/onnx-chainer.rb
onnx-red-chainer-0.1.1 lib/onnx-chainer.rb