File: __init__.py

package info (click to toggle)
python-autoray 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,744 kB
  • sloc: python: 6,043; makefile: 20
file content (109 lines) | stat: -rw-r--r-- 2,038 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
try:
    # -- Distribution mode --
    # import from _version.py generated by setuptools_scm during release
    from ._version import version as __version__
except ImportError:
    # -- Source mode --
    try:
        # use setuptools_scm to get the current version from src using git
        from setuptools_scm import get_version as _gv
        from pathlib import Path as _Path

        __version__ = _gv(_Path(__file__).parent.parent)
    except ImportError:
        # setuptools_scm is not available, use a default version
        __version__ = "0.0.0+unknown"


from .autoray import (
    astype,
    backend_like,
    compose,
    conj,
    dag,
    do,
    get_backend,
    get_common_dtype,
    get_dtype_name,
    get_lib_fn,
    get_namespace,
    imag,
    is_array,
    infer_backend_multi,
    infer_backend,
    ndim,
    real,
    register_backend,
    register_function,
    reshape,
    set_backend,
    shape,
    size,
    to_backend_dtype,
    to_numpy,
    transpose,
    # tree utilities
    tree_apply,
    tree_flatten,
    tree_iter,
    tree_map,
    tree_unflatten,
    # the numpy mimic submodule
    numpy,
)
from .compiler import autojit
from . import lazy

# useful constants
from math import (
    e,
    pi,
    inf,
    nan,
)

__all__ = (
    "do",
    "get_backend",
    "set_backend",
    "backend_like",
    "infer_backend",
    "infer_backend_multi",
    "get_lib_fn",
    "get_namespace",
    "shape",
    "ndim",
    "size",
    "conj",
    "transpose",
    "dag",
    "real",
    "imag",
    "reshape",
    "to_backend_dtype",
    "get_dtype_name",
    "get_common_dtype",
    "astype",
    "to_numpy",
    "register_backend",
    "register_function",
    # tree utilities
    "is_array",
    "tree_map",
    "tree_iter",
    "tree_apply",
    "tree_flatten",
    "tree_unflatten",
    "compose",
    # the numpy mimic submodule
    "numpy",
    # abstract function compilation
    "autojit",
    # lazy array library
    "lazy",
    # math constants,
    "e",
    "pi",
    "inf",
    "nan",
)