@@ -1271,6 +1271,7 @@ def ones(
1271
1271
shape : ShapeLike ,
1272
1272
dtype : DTypeLike | None = None ,
1273
1273
* ,
1274
+ out : paddle .Tensor | None = None ,
1274
1275
device : PlaceLike | None = None ,
1275
1276
requires_grad : bool = False ,
1276
1277
name : str | None = None ,
@@ -1284,6 +1285,7 @@ def ones(
1284
1285
If ``shape`` is an Tensor, it should be an 1-D Tensor which represents a list.
1285
1286
dtype (np.dtype|str, optional): Data type of output Tensor, it should be one of
1286
1287
bool, float16, float32, float64, int32 and int64. If it is set to None, the data type will be float32.
1288
+ out(Tensor, optional): The output tensor.
1287
1289
device(PlaceLike|None, optional): The desired device of returned tensor.
1288
1290
if None, uses the current device for the default tensor type (see paddle.device.set_device()).
1289
1291
device will be the CPU for CPU tensor types and the current CUDA device for CUDA tensor types. Default: None.
@@ -1325,6 +1327,7 @@ def ones(
1325
1327
shape ,
1326
1328
1 ,
1327
1329
dtype ,
1330
+ out = out ,
1328
1331
device = device ,
1329
1332
requires_grad = requires_grad ,
1330
1333
name = name ,
@@ -1390,6 +1393,7 @@ def zeros(
1390
1393
shape : ShapeLike ,
1391
1394
dtype : DTypeLike | None = None ,
1392
1395
* ,
1396
+ out : paddle .Tensor | None = None ,
1393
1397
device : PlaceLike | None = None ,
1394
1398
requires_grad : bool = False ,
1395
1399
name : str | None = None ,
@@ -1403,12 +1407,13 @@ def zeros(
1403
1407
If ``shape`` is an Tensor, it should be an 1-D Tensor which represents a list.
1404
1408
dtype(np.dtype|str, optional): Data type of output Tensor, it supports
1405
1409
bool, float16, float32, float64, int32 and int64. Default: if None, the data type is float32.
1406
- name(str|None, optional): The default value is None. Normally there is no need for user to set this
1407
1410
property. For more information, please refer to :ref:`api_guide_Name`.
1411
+ out(Tensor, optional): The output tensor.
1408
1412
device(PlaceLike|None, optional): The desired device of returned tensor.
1409
1413
if None, uses the current device for the default tensor type (see paddle.device.set_device()).
1410
1414
device will be the CPU for CPU tensor types and the current CUDA device for CUDA tensor types. Default: None.
1411
1415
requires_grad(bool, optional): If autograd should record operations on the returned tensor. Default: False.
1416
+ name(str|None, optional): The default value is None. Normally there is no need for user to set this
1412
1417
1413
1418
Returns:
1414
1419
Tensor: A tensor of data type :attr:`dtype` with shape :attr:`shape` and all elements set to 0.
@@ -1445,6 +1450,7 @@ def zeros(
1445
1450
shape ,
1446
1451
0 ,
1447
1452
dtype ,
1453
+ out = out ,
1448
1454
device = device ,
1449
1455
requires_grad = requires_grad ,
1450
1456
name = name ,
@@ -1516,6 +1522,7 @@ def eye(
1516
1522
num_columns : int | None = None ,
1517
1523
dtype : DTypeLike | None = None ,
1518
1524
* ,
1525
+ out : paddle .Tensor | None = None ,
1519
1526
device : PlaceLike | None = None ,
1520
1527
requires_grad : bool = False ,
1521
1528
name : str | None = None ,
@@ -1531,6 +1538,7 @@ def eye(
1531
1538
dtype(np.dtype|str, optional): The data type of the returned Tensor.
1532
1539
It should be int32, int64, float16, float32, float64, complex64, complex128. Default: if None, the data type
1533
1540
is float32.
1541
+ out(Tensor, optional): The output tensor.
1534
1542
device(PlaceLike|None, optional): The desired device of returned tensor.
1535
1543
if None, uses the current device for the default tensor type (see paddle.device.set_device()).
1536
1544
device will be the CPU for CPU tensor types and the current CUDA device for CUDA tensor types. Default: None.
@@ -1585,6 +1593,7 @@ def _check_attr(attr, message):
1585
1593
if device is not None
1586
1594
else _current_expected_place ()
1587
1595
),
1596
+ out = out ,
1588
1597
)
1589
1598
if requires_grad is True :
1590
1599
tensor .stop_gradient = False
@@ -1629,6 +1638,7 @@ def full(
1629
1638
fill_value : bool | float | paddle .Tensor ,
1630
1639
dtype : DTypeLike | None = None ,
1631
1640
* ,
1641
+ out : paddle .Tensor | None = None ,
1632
1642
device : PlaceLike | None = None ,
1633
1643
requires_grad : bool = False ,
1634
1644
name : str | None = None ,
@@ -1651,6 +1661,7 @@ def full(
1651
1661
dtype(np.dtype|str, optional): Data type of the output Tensor
1652
1662
which can be float16, float32, float64, int32, int64, if dtype is `None`, the data
1653
1663
type of created Tensor is `float32`.
1664
+ out(Tensor, optional): The output tensor.
1654
1665
device(PlaceLike|None, optional): The desired device of returned tensor.
1655
1666
if None, uses the current device for the default tensor type (see paddle.device.set_device()).
1656
1667
device will be the CPU for CPU tensor types and the current CUDA device for CUDA tensor types. Default: None.
@@ -1706,7 +1717,12 @@ def full(
1706
1717
dtype = paddle .get_default_dtype ()
1707
1718
1708
1719
tensor = fill_constant (
1709
- shape = shape , dtype = dtype , value = fill_value , place = device , name = name
1720
+ shape = shape ,
1721
+ dtype = dtype ,
1722
+ value = fill_value ,
1723
+ out = out ,
1724
+ place = device ,
1725
+ name = name ,
1710
1726
)
1711
1727
if requires_grad is True :
1712
1728
tensor .stop_gradient = False
@@ -2576,6 +2592,7 @@ def empty(
2576
2592
shape : ShapeLike ,
2577
2593
dtype : DTypeLike | None = None ,
2578
2594
* ,
2595
+ out : paddle .Tensor | None = None ,
2579
2596
device : PlaceLike | None = None ,
2580
2597
requires_grad : bool = False ,
2581
2598
name : str | None = None ,
@@ -2591,6 +2608,7 @@ def empty(
2591
2608
which can be bool, float16, float32, float64, int32, int64, complex64, complex128 if dtype is `None`, the data
2592
2609
type of created Tensor use global default dtype (see ``get_default_dtype``
2593
2610
for details).
2611
+ out(Tensor, optional): The output tensor.
2594
2612
device(PlaceLike|None, optional): The desired device of returned tensor.
2595
2613
if None, uses the current device for the default tensor type (see paddle.device.set_device()).
2596
2614
device will be the CPU for CPU tensor types and the current CUDA device for CUDA tensor types. Default: None.
@@ -2680,6 +2698,7 @@ def empty(
2680
2698
if device is not None
2681
2699
else _current_expected_place ()
2682
2700
),
2701
+ out = out ,
2683
2702
)
2684
2703
if requires_grad is True :
2685
2704
tensor .stop_gradient = False
@@ -3201,7 +3220,7 @@ def complex(
3201
3220
real (Tensor): The real component. The data type should be 'float32' or 'float64'.
3202
3221
imag (Tensor): The image component. The data type should be the same as ``real``.
3203
3222
name(str|None, optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None.
3204
- out (Tensor|None, optional): The output tensor. Default: None.
3223
+ out(Tensor|None, optional): The output tensor. Default: None.
3205
3224
3206
3225
Returns:
3207
3226
Tensor, The output tensor. The data type is 'complex64' or 'complex128', with the same precision as ``real`` and ``imag``.
0 commit comments