ruby-numo / numo-narray

Ruby/Numo::NArray - New NArray class library
http://ruby-numo.github.io/narray/
BSD 3-Clause "New" or "Revised" License
418 stars 42 forks source link

3d narray assignment problem #23

Closed kojix2 closed 8 years ago

kojix2 commented 8 years ago

Hello. Thank you for quick update. I have a strange problem.

require 'numo/narray'

a = Numo::Int32.new(3,3).seq
b = Numo::Int32.ones(3,3)

c = Numo::Int32.zeros(2, *a.shape)
p c.shape
# [2, 3, 3]

c[0, true, true] = a
c[1, true, true] = b
p c
# Numo::Int32#shape=[2,3,3]
# [[[1, 1, 1], 
#   [1, 1, 1], 
#   [1, 1, 1]], 
#   [[0, 0, 0], 
#   [0, 0, 0], 
#   [0, 0, 0]]]

p c[1, true, true]
# Numo::Int32(view)#shape=[3,3]
# [[0, 0, 0], 
#  [0, 0, 0], 
#  [0, 0, 0]]

something wrong?

(Scirubyの皆様いつも迅速な対応ありがとうございます。今後は medfreak.info ではなくこちらに報告します。よろしくおねがいします。)

masa16 commented 8 years ago

Fixed. https://github.com/ruby-numo/narray/commit/7d920f48f2f8efc84abef084777acf5b434a0dc7 いつも報告して下さりありがとうございます。