Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1"""`uarray` provides functions for generating multimethods that dispatch to 

2multiple different backends 

3 

4This should be imported, rather than `_uarray` so that an installed version could 

5be used instead, if available. This means that users can call 

6`uarray.set_backend` directly instead of going through SciPy. 

7 

8""" 

9 

10 

11# Prefer an installed version of uarray, if available 

12try: 

13 import uarray as _uarray 

14except ImportError: 

15 _has_uarray = False 

16else: 

17 from scipy._lib._pep440 import Version as _Version 

18 

19 _has_uarray = _Version(_uarray.__version__) >= _Version("0.5") 

20 del _uarray 

21 del _Version 

22 

23 

24if _has_uarray: 

25 from uarray import * 

26 from uarray import _Function 

27else: 

28 from ._uarray import * 

29 from ._uarray import _Function 

30 

31del _has_uarray