Why not just let the error pass and don't catch it?


On Mon, May 5, 2014 at 2:31 PM, abergeron <notifications@github.com> wrote:

> In theano/sandbox/linalg/ops.py:
>
> > +        x = as_tensor_variable(x)
> > +        assert x.ndim == 2, "The input of svd function should be a matrix."
> > +        w = theano.tensor.matrix(dtype=x.dtype)
> > +        u = theano.tensor.matrix(dtype=x.dtype)
> > +        v = theano.tensor.matrix(dtype=x.dtype)
> > +        return Apply(self, [x], [w, u, v])
> > +
> > +    def perform(self, node, (x,), (w, u, v)):
> > +        try:
> > +            assert x.ndim == 2, "The input of svd function should be a matrix."
> > +            w[0], u[0], v[0] = self._numop(x,
> > +                                           self.full_matrices,
> > +                                           self.compute_uv)
> > +        except numpy.linalg.LinAlgError:
> > +            logger.debug('Failed to find %s of %s' % (self._numop.__name__,
> > +                                                      node.inputs[0]))
>
> Do we really want to log errors from Ops?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Theano/Theano/pull/1827/files#r12292026>
> .
>