def equals(self, other, failing_expression=False):
        try:
            if self.shape != other.shape:
                return False
            rv = True
            for i in range(self.rows):
                for j in range(self.cols):
                    ans = self[i, j].equals(other[i, j], failing_expression)
                    if ans is False:
                        return False
                    elif ans is not True and rv is True:
                        rv = ans
            return rv
        except AttributeError:
            return False
Applies ``equals`` to corresponding elements of the matrices,
dataset/ETHPy150Open sympy/sympy/sympy/matrices/dense.py/DenseMatrix.equals