def _call(self, x, out=None):
        """Return ``self(x[, out])``."""
        # Lazy import to improve `import odl` time
        import scipy.sparse

        if out is None:
            if scipy.sparse.isspmatrix(self.matrix):
                out = self.matrix.dot(x)
            else:
                dot = np.tensordot(self.matrix, x, axes=(1, self.axis))
                # New axis ends up as first, need to swap it to its place
                out = moveaxis(dot, 0, self.axis)
        else:
            if scipy.sparse.isspmatrix(self.matrix):
                # Unfortunately, there is no native in-place dot product for
                # sparse matrices
                out[:] = self.matrix.dot(x)
            elif (parse_version(np.__version__) < parse_version('1.13.0') and
                  x is out and
                  self.range.ndim == 1):
                # Workaround for bug in Numpy < 1.13 with aliased in and
                # out in np.dot
                out[:] = self.matrix.dot(x)
            elif self.range.ndim == 1:
                with writable_array(out) as out_arr:
                    self.matrix.dot(x, out=out_arr)
            else:
                # Could use einsum to have out, but it's damn slow
                # TODO: investigate speed issue
                dot = np.tensordot(self.matrix, x, axes=(1, self.axis))
                # New axis ends up as first, need to move it to its place
                out[:] = moveaxis(dot, 0, self.axis)

        return out
def _call ( self , x , out = None ) : import scipy . sparse if out is None : if scipy . sparse . isspmatrix ( self . matrix ) : out = self . matrix . dot ( x ) else : dot = np . tensordot ( self . matrix , x , axes = ( 1 , self . axis ) ) out = moveaxis ( dot , 0 , self . axis ) else : if scipy . sparse . isspmatrix ( self . matrix ) : out [ : ] = self . matrix . dot ( x ) elif ( parse_version ( np . __version__ ) < parse_version ( '1.13.0' ) and x is out and self . range . ndim == 1 ) : out [ : ] = self . matrix . dot ( x ) elif self . range . ndim == 1 : with writable_array ( out ) as out_arr : self . matrix . dot ( x , out = out_arr ) else : dot = np . tensordot ( self . matrix , x , axes = ( 1 , self . axis ) ) out [ : ] = moveaxis ( dot , 0 , self . axis ) return out
Return ``self(x[, out])``.