Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions python/paddle/tensor/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import paddle
from paddle import _C_ops
from paddle.utils import deprecated
from paddle.utils.decorator_utils import ParamAliasDecorator, SizeArgsDecorator
from paddle.utils.inplace_utils import inplace_apis_in_dygraph_only

Expand Down Expand Up @@ -1518,8 +1519,8 @@ def zeros_like(


def eye(
num_rows: int,
num_columns: int | None = None,
num_rows: int | paddle.Tensor,
num_columns: int | paddle.Tensor | None = None,
dtype: DTypeLike | None = None,
name: str | None = None,
*,
Expand All @@ -1532,8 +1533,8 @@ def eye(
This function constructs 2-D Tensor with ones on the diagonal and zeros elsewhere.

Args:
num_rows(int): the number of rows in each batch Tensor.
num_columns(int|None, optional): the number of columns in each batch Tensor.
num_rows(int | paddle.Tensor): the number of rows in each batch Tensor.
num_columns(int | paddle.Tensor | None, optional): the number of columns in each batch Tensor.
If None, default: num_rows.
dtype(np.dtype|str, optional): The data type of the returned Tensor.
It should be int32, int64, float16, float32, float64, complex64, complex128. Default: if None, the data type
Expand Down Expand Up @@ -1919,6 +1920,12 @@ def arange(
return out


@deprecated(
reason=(
"paddle.range is deprecated and will be removed in a future release because its behavior is inconsistent with Python's range builtin."
"Instead, use paddle.arange, which produces values in [start, end)"
)
)
def range(
start: float | paddle.Tensor = 0,
end: float | paddle.Tensor | None = None,
Expand Down Expand Up @@ -2795,6 +2802,7 @@ def diag(
return out


@SizeArgsDecorator()
def empty(
shape: ShapeLike,
dtype: DTypeLike | None = None,
Expand Down