Hi, it looks like map tries to return the same Numo type.
a = Numo::Int64.cast([1, 2, 3])
a.map { |v| v + 0.5 } # returns Numo::Int64 with [1, 2, 3]
a.map { |v| "#{v}!!" } # errors with TypeError (no implicit conversion of String into Integer)
It would be nice if map looked at the result type. This way, it could support any transformation (like Ruby does).
Hi, it looks like
map
tries to return the same Numo type.It would be nice if
map
looked at the result type. This way, it could support any transformation (like Ruby does).