Class: Tensorflow::FFI::Output

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/tensorflow/ffi.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.array_to_ptr(outputs) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/tensorflow/ffi.rb', line 45

def self.array_to_ptr(outputs)
  result = ::FFI::MemoryPointer.new(self, outputs.length)
  outputs.each_with_index do |output, i|
    copy_output = self.new(result[i])
    copy_output[:oper] = output[:oper]
    copy_output[:index] = output[:index]
  end
  result
end

Instance Method Details

#to_sObject



55
56
57
# File 'lib/tensorflow/ffi.rb', line 55

def to_s
  "#{self[:oper]}: #{self[:index]}"
end