Skip to content

Commit e3f9c5d

Browse files
refine creation.py
1 parent d434c9e commit e3f9c5d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

python/paddle/tensor/creation.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,8 +1518,8 @@ def zeros_like(
15181518

15191519

15201520
def eye(
1521-
num_rows: int,
1522-
num_columns: int | None = None,
1521+
num_rows: int | paddle.Tensor,
1522+
num_columns: int | paddle.Tensor | None = None,
15231523
dtype: DTypeLike | None = None,
15241524
name: str | None = None,
15251525
*,
@@ -1532,8 +1532,8 @@ def eye(
15321532
This function constructs 2-D Tensor with ones on the diagonal and zeros elsewhere.
15331533
15341534
Args:
1535-
num_rows(int): the number of rows in each batch Tensor.
1536-
num_columns(int|None, optional): the number of columns in each batch Tensor.
1535+
num_rows(int | paddle.Tensor): the number of rows in each batch Tensor.
1536+
num_columns(int | paddle.Tensor | None, optional): the number of columns in each batch Tensor.
15371537
If None, default: num_rows.
15381538
dtype(np.dtype|str, optional): The data type of the returned Tensor.
15391539
It should be int32, int64, float16, float32, float64, complex64, complex128. Default: if None, the data type
@@ -2795,6 +2795,7 @@ def diag(
27952795
return out
27962796

27972797

2798+
@SizeArgsDecorator()
27982799
def empty(
27992800
shape: ShapeLike,
28002801
dtype: DTypeLike | None = None,

0 commit comments

Comments
 (0)