File: __init__.py

package info (click to toggle)
theano 1.0.3+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 30,752 kB
  • sloc: python: 141,182; ansic: 9,505; makefile: 259; sh: 214; pascal: 81
file content (23 lines) | stat: -rw-r--r-- 838 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from __future__ import absolute_import, print_function, division
import sys

try:
    import scipy
    scipy_ver = [int(n) for n in scipy.__version__.split('.')[:2]]
    enable_sparse = bool(scipy_ver >= [0, 7])
    if not enable_sparse:
        sys.stderr.write("WARNING: scipy version = %s."
                " We request version >=0.7.0 for the sparse code as it has"
                " bugs fixed in the sparse matrix code.\n" % scipy.__version__)
except ImportError:
    enable_sparse = False
    sys.stderr.write("WARNING: scipy can't be imported."
            " We disable the sparse matrix code.")

from theano.sparse.type import *

if enable_sparse:
    from theano.sparse.basic import *
    from theano.sparse import opt
    from theano.sparse import sharedvar
    from theano.sparse.sharedvar import sparse_constructor as shared