lib/onnxruntime/utils.rb in onnxruntime-0.1.1 vs lib/onnxruntime/utils.rb in onnxruntime-0.1.2

- old
+ new

@@ -1,7 +1,13 @@ 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