xbarray 0.0.1a13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- array_api_typing/__init__.py +9 -0
- array_api_typing/typing_2024_12/__init__.py +12 -0
- array_api_typing/typing_2024_12/_api_constant.py +32 -0
- array_api_typing/typing_2024_12/_api_fft_typing.py +717 -0
- array_api_typing/typing_2024_12/_api_linalg_typing.py +897 -0
- array_api_typing/typing_2024_12/_api_return_typing.py +103 -0
- array_api_typing/typing_2024_12/_api_typing.py +5855 -0
- array_api_typing/typing_2024_12/_array_typing.py +1265 -0
- array_api_typing/typing_compat/__init__.py +12 -0
- array_api_typing/typing_compat/_api_typing.py +27 -0
- array_api_typing/typing_compat/_array_typing.py +36 -0
- array_api_typing/typing_extra/__init__.py +12 -0
- array_api_typing/typing_extra/_api_typing.py +651 -0
- array_api_typing/typing_extra/_at.py +87 -0
- xbarray/__init__.py +1 -0
- xbarray/backends/_cls_base.py +9 -0
- xbarray/backends/_implementations/_common/implementations.py +87 -0
- xbarray/backends/_implementations/jax/__init__.py +33 -0
- xbarray/backends/_implementations/jax/_extra.py +127 -0
- xbarray/backends/_implementations/jax/_typing.py +15 -0
- xbarray/backends/_implementations/jax/random.py +115 -0
- xbarray/backends/_implementations/numpy/__init__.py +25 -0
- xbarray/backends/_implementations/numpy/_extra.py +98 -0
- xbarray/backends/_implementations/numpy/_typing.py +14 -0
- xbarray/backends/_implementations/numpy/random.py +105 -0
- xbarray/backends/_implementations/pytorch/__init__.py +26 -0
- xbarray/backends/_implementations/pytorch/_extra.py +135 -0
- xbarray/backends/_implementations/pytorch/_typing.py +13 -0
- xbarray/backends/_implementations/pytorch/random.py +101 -0
- xbarray/backends/base.py +218 -0
- xbarray/backends/jax.py +19 -0
- xbarray/backends/numpy.py +19 -0
- xbarray/backends/pytorch.py +22 -0
- xbarray/jax.py +4 -0
- xbarray/numpy.py +4 -0
- xbarray/pytorch.py +4 -0
- xbarray/transformations/pointcloud/__init__.py +1 -0
- xbarray/transformations/pointcloud/base.py +449 -0
- xbarray/transformations/pointcloud/jax.py +24 -0
- xbarray/transformations/pointcloud/numpy.py +23 -0
- xbarray/transformations/pointcloud/pytorch.py +23 -0
- xbarray/transformations/rotation_conversions/__init__.py +1 -0
- xbarray/transformations/rotation_conversions/base.py +713 -0
- xbarray/transformations/rotation_conversions/jax.py +41 -0
- xbarray/transformations/rotation_conversions/numpy.py +41 -0
- xbarray/transformations/rotation_conversions/pytorch.py +41 -0
- xbarray-0.0.1a13.dist-info/METADATA +20 -0
- xbarray-0.0.1a13.dist-info/RECORD +51 -0
- xbarray-0.0.1a13.dist-info/WHEEL +5 -0
- xbarray-0.0.1a13.dist-info/licenses/LICENSE +21 -0
- xbarray-0.0.1a13.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from typing import Protocol, TypeVar, Optional, Any, Tuple, Union, Type, TypedDict, List, TypeAlias
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from abc import abstractmethod
|
|
4
|
+
from ._array_typing import Device, DType
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"SupportsBufferProtocol",
|
|
8
|
+
"DefaultDataTypes",
|
|
9
|
+
"DataTypes",
|
|
10
|
+
"Capabilities",
|
|
11
|
+
"finfo_object",
|
|
12
|
+
"iinfo_object",
|
|
13
|
+
"NestedSequence",
|
|
14
|
+
"Info"
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
SupportsBufferProtocol = TypeVar("SupportsBufferProtocol")
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
https://github.com/data-apis/array-api/blob/main/src/array_api_stubs/_2024_12/_types.py#L55
|
|
21
|
+
"""
|
|
22
|
+
DefaultDataTypes = TypedDict(
|
|
23
|
+
"DefaultDataTypes",
|
|
24
|
+
{
|
|
25
|
+
"real floating": DType,
|
|
26
|
+
"complex floating": DType,
|
|
27
|
+
"integral": DType,
|
|
28
|
+
"indexing": DType,
|
|
29
|
+
},
|
|
30
|
+
)
|
|
31
|
+
DataTypes = TypedDict(
|
|
32
|
+
"DataTypes",
|
|
33
|
+
{
|
|
34
|
+
"bool": DType,
|
|
35
|
+
"float32": DType,
|
|
36
|
+
"float64": DType,
|
|
37
|
+
"complex64": DType,
|
|
38
|
+
"complex128": DType,
|
|
39
|
+
"int8": DType,
|
|
40
|
+
"int16": DType,
|
|
41
|
+
"int32": DType,
|
|
42
|
+
"int64": DType,
|
|
43
|
+
"uint8": DType,
|
|
44
|
+
"uint16": DType,
|
|
45
|
+
"uint32": DType,
|
|
46
|
+
"uint64": DType,
|
|
47
|
+
},
|
|
48
|
+
total=False,
|
|
49
|
+
)
|
|
50
|
+
Capabilities = TypedDict(
|
|
51
|
+
"Capabilities",
|
|
52
|
+
{
|
|
53
|
+
"boolean indexing": bool,
|
|
54
|
+
"data-dependent shapes": bool,
|
|
55
|
+
"max rank": Optional[int],
|
|
56
|
+
},
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
@dataclass
|
|
60
|
+
class finfo_object:
|
|
61
|
+
"""Dataclass returned by `finfo`."""
|
|
62
|
+
bits: int
|
|
63
|
+
eps: float
|
|
64
|
+
max: float
|
|
65
|
+
min: float
|
|
66
|
+
smallest_normal: float
|
|
67
|
+
dtype: DType
|
|
68
|
+
|
|
69
|
+
@dataclass
|
|
70
|
+
class iinfo_object:
|
|
71
|
+
"""Dataclass returned by `iinfo`."""
|
|
72
|
+
bits: int
|
|
73
|
+
max: int
|
|
74
|
+
min: int
|
|
75
|
+
dtype: DType
|
|
76
|
+
|
|
77
|
+
_T_co = TypeVar("_T_co", covariant=True)
|
|
78
|
+
class NestedSequence(Protocol[_T_co]):
|
|
79
|
+
def __getitem__(self, key: int, /) -> Union[_T_co, 'NestedSequence[_T_co]']:
|
|
80
|
+
...
|
|
81
|
+
|
|
82
|
+
def __len__(self, /) -> int:
|
|
83
|
+
...
|
|
84
|
+
|
|
85
|
+
class Info(Protocol):
|
|
86
|
+
"""Namespace returned by `__array_namespace_info__`."""
|
|
87
|
+
|
|
88
|
+
def capabilities(self) -> Capabilities:
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
def default_device(self) -> Device:
|
|
92
|
+
...
|
|
93
|
+
|
|
94
|
+
def default_dtypes(self, *, device: Optional[Device]) -> DefaultDataTypes:
|
|
95
|
+
...
|
|
96
|
+
|
|
97
|
+
def devices(self) -> List[Device]:
|
|
98
|
+
...
|
|
99
|
+
|
|
100
|
+
def dtypes(
|
|
101
|
+
self, *, device: Optional[Device] = None, kind: Optional[Union[str, Tuple[str, ...]]] = None
|
|
102
|
+
) -> DataTypes: # In the original signature there's no default parameters for `device` and `kind`, but we add them since they exist in `array_api_compat` modules
|
|
103
|
+
...
|