lib/cumo/narray/extra.rb in cumo-0.3.0 vs lib/cumo/narray/extra.rb in cumo-0.3.1
- old
+ new
@@ -1131,9 +1131,12 @@
# @param b [Cumo::NArray]
# @return [Cumo::NArray] return dot product
def dot(b)
t = self.class::UPCAST[b.class]
+ if self.ndim == 0 and b.ndim == 0
+ return self * b
+ end
if [SFloat, DFloat, SComplex, DComplex].include?(t)
b = self.class.asarray(b)
case self.ndim
when 1
case b.ndim