I would put this in theano/__init__.py, as it reuse sparse and tensor. We put that kind of stuff there for now.

But I would move the test for scipy.sparse at the end, and input scipy just before that. scipy is an optional dependency for Theano.