Hello,
I'm trying to understand what's happening here exactly, as I'm not knowing Ruby, and trying to translate it to Swift:
input.each_with_index do |input_scalar, input_index|
output.each_with_index do |output_scalar, output_index|
self.matrix[input_index] ||= []
self.matrix[input_index][output_index] ||= 0
self.matrix[input_index][output_index] += input_buffer[input_index] * output_buffer[output_index]
end
end
What is the ||= for? What exactly is achieved by this fragment in Network.rb?
Thanks for your support!
Best regards,
Hardy
Hello,
I'm trying to understand what's happening here exactly, as I'm not knowing Ruby, and trying to translate it to Swift:
What is the
||= for?What exactly is achieved by this fragment in Network.rb?Thanks for your support!
Best regards,
Hardy