numo-narray icon indicating copy to clipboard operation
numo-narray copied to clipboard

Inconsistency in `Numo::DFloat#dot` after `require 'numo/linalg'

Open giuse opened this issue 6 years ago • 0 comments

Not sure whether this should go here or in numo-linalg.

require 'numo/narray'
# => true
a = Numo::DFloat.zeros(1,10)
# => Numo::DFloat#shape=[1,10]
# [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
b = Numo::DFloat.zeros(1)
# => Numo::DFloat#shape=[1]
# [0]
a.dot b
# => Numo::DFloat#shape=[1]
# [0]
require 'numo/linalg'
# => true
a.dot b
# Numo::NArray::ShapeError: na must be == nx: na=10 nx=1
# from /home/giuse/.rvm/gems/ruby-2.4.2/gems/numo-linalg-0.1.2/lib/numo/linalg/function.rb:20:in `dgemv'

And even worse (this was my initial failure):

# starting from fresh console
require 'numo/linalg'
# => true
a = Numo::DFloat.zeros(1)
# => Numo::DFloat#shape=[1]
# [0]
b = Numo::DFloat.zeros(1, 5600)
# => Numo::DFloat#shape=[1,5600]
# [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...]]
a.dot b
# /home/giuse/.rvm/gems/ruby-2.4.2/gems/numo-linalg-0.1.2/lib/numo/linalg/function.rb:20: [BUG] Segmentation fault at 0x00000000038f34a0
# ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
# [full stack trace available upon request]

Gem versions:

$ gem list numo

*** LOCAL GEMS ***

numo-gsl (0.1.2)
numo-linalg (0.1.2)
numo-narray (0.9.1.2)

giuse avatar May 01 '18 10:05 giuse