diff options
Diffstat (limited to 'candle-pyo3/py_src')
-rw-r--r-- | candle-pyo3/py_src/candle/__init__.pyi | 16 | ||||
-rw-r--r-- | candle-pyo3/py_src/candle/functional/__init__.pyi | 2 | ||||
-rw-r--r-- | candle-pyo3/py_src/candle/typing/__init__.py | 2 | ||||
-rw-r--r-- | candle-pyo3/py_src/candle/utils/__init__.pyi | 2 |
4 files changed, 12 insertions, 10 deletions
diff --git a/candle-pyo3/py_src/candle/__init__.pyi b/candle-pyo3/py_src/candle/__init__.pyi index 43722168..35b17680 100644 --- a/candle-pyo3/py_src/candle/__init__.pyi +++ b/candle-pyo3/py_src/candle/__init__.pyi @@ -1,7 +1,7 @@ # Generated content DO NOT EDIT from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence from os import PathLike -from candle.typing import _ArrayLike, Device, Scalar, Index +from candle.typing import _ArrayLike, Device, Scalar, Index, Shape class bf16(DType): pass @@ -26,21 +26,21 @@ class i64(DType): pass @staticmethod -def ones(shape: Sequence[int], dtype: Optional[DType] = None, device: Optional[Device] = None) -> Tensor: +def ones(*shape: Shape, dtype: Optional[DType] = None, device: Optional[Device] = None) -> Tensor: """ Creates a new tensor filled with ones. """ pass @staticmethod -def rand(shape: Sequence[int], device: Optional[Device] = None) -> Tensor: +def rand(*shape: Shape, device: Optional[Device] = None) -> Tensor: """ Creates a new tensor with random values. """ pass @staticmethod -def randn(shape: Sequence[int], device: Optional[Device] = None) -> Tensor: +def randn(*shape: Shape, device: Optional[Device] = None) -> Tensor: """ Creates a new tensor with random values from a normal distribution. """ @@ -67,7 +67,7 @@ class u8(DType): pass @staticmethod -def zeros(shape: Sequence[int], dtype: Optional[DType] = None, device: Optional[Device] = None) -> Tensor: +def zeros(*shape: Shape, dtype: Optional[DType] = None, device: Optional[Device] = None) -> Tensor: """ Creates a new tensor filled with zeros. """ @@ -174,7 +174,7 @@ class Tensor: Adds the two tensors, while broadcasting the right-hand-side tensor to match the shape of the left-hand-side tensor. """ pass - def broadcast_as(self, shape: Sequence[int]) -> Tensor: + def broadcast_as(self, *shape: Shape) -> Tensor: """ Broadcasts the tensor to the given shape. """ @@ -184,7 +184,7 @@ class Tensor: Divides the two tensors, while broadcasting the right-hand-side tensor to match the shape of the left-hand-side tensor. """ pass - def broadcast_left(self, shape: Sequence[int]) -> Tensor: + def broadcast_left(self, *shape: Shape) -> Tensor: """ Broadcasts the tensor to the given shape, adding new dimensions on the left. """ @@ -329,7 +329,7 @@ class Tensor: Get the `recip` of the tensor. """ pass - def reshape(self, shape: Sequence[int]) -> Tensor: + def reshape(self, *shape: Shape) -> Tensor: """ Reshapes the tensor to the given shape. """ diff --git a/candle-pyo3/py_src/candle/functional/__init__.pyi b/candle-pyo3/py_src/candle/functional/__init__.pyi index 5bf5c4c3..4f7c2aa6 100644 --- a/candle-pyo3/py_src/candle/functional/__init__.pyi +++ b/candle-pyo3/py_src/candle/functional/__init__.pyi @@ -1,7 +1,7 @@ # Generated content DO NOT EDIT from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence from os import PathLike -from candle.typing import _ArrayLike, Device, Scalar, Index +from candle.typing import _ArrayLike, Device, Scalar, Index, Shape from candle import Tensor, DType, QTensor @staticmethod diff --git a/candle-pyo3/py_src/candle/typing/__init__.py b/candle-pyo3/py_src/candle/typing/__init__.py index 66bc3d8a..b2262a97 100644 --- a/candle-pyo3/py_src/candle/typing/__init__.py +++ b/candle-pyo3/py_src/candle/typing/__init__.py @@ -18,3 +18,5 @@ Device = TypeVar("Device", CPU, CUDA) Scalar = Union[int, float] Index = Union[int, slice, None, "Ellipsis"] + +Shape = Union[int, Sequence[int]] diff --git a/candle-pyo3/py_src/candle/utils/__init__.pyi b/candle-pyo3/py_src/candle/utils/__init__.pyi index d3b93766..4ee51c29 100644 --- a/candle-pyo3/py_src/candle/utils/__init__.pyi +++ b/candle-pyo3/py_src/candle/utils/__init__.pyi @@ -1,7 +1,7 @@ # Generated content DO NOT EDIT from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence from os import PathLike -from candle.typing import _ArrayLike, Device, Scalar, Index +from candle.typing import _ArrayLike, Device, Scalar, Index, Shape from candle import Tensor, DType, QTensor @staticmethod |