def matmul(a, b): '''Matrix product of two datasets ''' a = _asarray(a) b = _asarray(b) prepend = a.rank == 1 if prepend: a.shape = 1, a.shape[0] append = b.rank == 1 if append: b.shape = b.shape[0], 1 m = _asarray(_linalg.matrixProduct(a._jdataset(), b._jdataset())) if prepend: m.shape = m.shape[1:] if append: m.shape = m.shape[:-1] return m
def matmul(a, b): '''Matrix product of two datasets ''' a = _asarray(a) b = _asarray(b) prepend = a.rank == 1 if prepend: a.shape = 1,a.shape[0] append = b.rank == 1 if append: b.shape = b.shape[0],1 m = _asarray(_linalg.matrixProduct(a._jdataset(), b._jdataset())) if prepend: m.shape = m.shape[1:] if append: m.shape = m.shape[:-1] return m