Sha256: cbb7c787d1776ad9a1445ec5c6382e999d14a4b78c65b8f314ccf776aa92983c

Contents?: true

Size: 183 Bytes

Versions: 2

Compression:

Stored size: 183 Bytes

Contents

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
onnxruntime-0.1.1 lib/onnxruntime/utils.rb
onnxruntime-0.1.0 lib/onnxruntime/utils.rb