Sha256: dbd58520c6396da20769f934c275ce02b27b18f61e8aecd3b45e67a04d704d17

Contents?: true

Size: 288 Bytes

Versions: 86

Compression:

Stored size: 288 Bytes

Contents

module OnnxRuntime
  module Utils
    class << self
      attr_accessor :mutex
    end
    self.mutex = Mutex.new

    def self.reshape(arr, dims)
      arr = arr.flatten
      dims[1..-1].reverse.each do |dim|
        arr = arr.each_slice(dim)
      end
      arr.to_a
    end
  end
end

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
onnxruntime-0.9.2-x86_64-linux lib/onnxruntime/utils.rb
onnxruntime-0.9.2-x86_64-darwin lib/onnxruntime/utils.rb
onnxruntime-0.9.2-x64-mingw lib/onnxruntime/utils.rb
onnxruntime-0.9.2-arm64-darwin lib/onnxruntime/utils.rb
onnxruntime-0.9.2-aarch64-linux lib/onnxruntime/utils.rb
onnxruntime-0.9.2 lib/onnxruntime/utils.rb
onnxruntime-0.9.0-x86_64-linux lib/onnxruntime/utils.rb
onnxruntime-0.9.0-x86_64-darwin lib/onnxruntime/utils.rb
onnxruntime-0.9.0-x64-mingw lib/onnxruntime/utils.rb
onnxruntime-0.9.0-arm64-darwin lib/onnxruntime/utils.rb
onnxruntime-0.9.0-aarch64-linux lib/onnxruntime/utils.rb
onnxruntime-0.9.0 lib/onnxruntime/utils.rb
onnxruntime-0.8.0-x86_64-linux lib/onnxruntime/utils.rb
onnxruntime-0.8.0-x86_64-darwin lib/onnxruntime/utils.rb
onnxruntime-0.8.0-x64-mingw lib/onnxruntime/utils.rb
onnxruntime-0.8.0-arm64-darwin lib/onnxruntime/utils.rb
onnxruntime-0.8.0-aarch64-linux lib/onnxruntime/utils.rb
onnxruntime-0.8.0 lib/onnxruntime/utils.rb
onnxruntime-0.7.7-x86_64-linux lib/onnxruntime/utils.rb
onnxruntime-0.7.7-x86_64-darwin lib/onnxruntime/utils.rb