Skip to content

Commit 2ad0057

Browse files
authored
Fix Numberic Numeric(#69148)
1 parent 1f4ea48 commit 2ad0057

File tree

12 files changed

+33
-33
lines changed

12 files changed

+33
-33
lines changed

python/paddle/_typing/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
# Basic
1919
from .basic import (
2020
NestedList as NestedList,
21-
NestedNumbericSequence as NestedNumbericSequence,
21+
NestedNumericSequence as NestedNumericSequence,
2222
NestedSequence as NestedSequence,
2323
NestedStructure as NestedStructure,
24-
Numberic as Numberic,
25-
NumbericSequence as NumbericSequence,
24+
Numeric as Numeric,
25+
NumericSequence as NumericSequence,
2626
ParamAttrLike as ParamAttrLike,
2727
TensorIndex as TensorIndex,
2828
TensorLike as TensorLike,

python/paddle/_typing/basic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
from paddle.regularizer import WeightDecayRegularizer
3737

3838

39-
Numberic: TypeAlias = Union[int, float, complex, np.number, "Tensor"]
40-
TensorLike: TypeAlias = Union[npt.NDArray[Any], "Tensor", Numberic]
39+
Numeric: TypeAlias = Union[int, float, complex, np.number, "Tensor"]
40+
TensorLike: TypeAlias = Union[npt.NDArray[Any], "Tensor", Numeric]
4141
_TensorIndexItem: TypeAlias = Union[
4242
None, bool, int, slice, "Tensor", EllipsisType
4343
]
@@ -55,8 +55,8 @@
5555
NestedStructure = Union[
5656
_T, Dict[str, "NestedStructure[_T]"], Sequence["NestedStructure[_T]"]
5757
]
58-
NumbericSequence = Sequence[Numberic]
59-
NestedNumbericSequence: TypeAlias = NestedSequence[Numberic]
58+
NumericSequence = Sequence[Numeric]
59+
NestedNumericSequence: TypeAlias = NestedSequence[Numeric]
6060
TensorOrTensors: TypeAlias = Union["Tensor", Sequence["Tensor"]]
6161

6262
ParamAttrLike: TypeAlias = Union[

python/paddle/distributed/auto_parallel/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
from paddle import Tensor
8585
from paddle._typing import (
8686
DTypeLike,
87-
NestedNumbericSequence,
87+
NestedNumericSequence,
8888
PlaceLike,
8989
TensorLike,
9090
)
@@ -210,7 +210,7 @@ def sharding_specs(self):
210210

211211

212212
def shard_tensor(
213-
data: Tensor | TensorLike | NestedNumbericSequence,
213+
data: Tensor | TensorLike | NestedNumericSequence,
214214
mesh: ProcessMesh,
215215
placements: list[Placement],
216216
dtype: DTypeLike | None = None,

python/paddle/distributed/auto_parallel/process_mesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import numpy.typing as npt
3030

31-
from paddle._typing import NestedNumbericSequence
31+
from paddle._typing import NestedNumericSequence
3232

3333
_NumpyShapeLike = Union[SupportsIndex, Sequence[SupportsIndex]]
3434

@@ -109,7 +109,7 @@ class ProcessMesh(core.ProcessMesh):
109109

110110
def __init__(
111111
self,
112-
mesh: npt.NDArray[Any] | NestedNumbericSequence | None = None,
112+
mesh: npt.NDArray[Any] | NestedNumericSequence | None = None,
113113
dim_names: list[str] | None = None,
114114
shape: _NumpyShapeLike | None = None,
115115
process_ids: Iterable[Any] | None = None,

python/paddle/distributed/fleet/base/util_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import numpy.typing as npt
4141

4242
from paddle import Tensor
43-
from paddle._typing import NestedNumbericSequence
43+
from paddle._typing import NestedNumericSequence
4444
from paddle.base.framework import Block
4545
from paddle.distributed.fleet.base.distributed_strategy import (
4646
DistributedStrategy,
@@ -80,7 +80,7 @@ def _set_file_system(self, fs_client: FS) -> None:
8080

8181
def all_reduce(
8282
self,
83-
input: NestedNumbericSequence | npt.NDArray[Any],
83+
input: NestedNumericSequence | npt.NDArray[Any],
8484
mode: Literal["sum", "min", "max"] = "sum",
8585
comm_world: Literal["worker", "server", "all"] = "worker",
8686
) -> npt.NDArray[Any] | None:

python/paddle/distribution/distribution.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from typing_extensions import TypeGuard
3535

3636
from paddle import Tensor
37-
from paddle._typing import NestedNumbericSequence, TensorLike
37+
from paddle._typing import NestedNumericSequence, TensorLike
3838

3939

4040
class Distribution:
@@ -149,7 +149,7 @@ def _extend_shape(self, sample_shape: Sequence[int] | Tensor) -> Tensor:
149149
)
150150

151151
def _validate_args(
152-
self, *args: TensorLike | NestedNumbericSequence
152+
self, *args: TensorLike | NestedNumericSequence
153153
) -> TypeGuard[Tensor]:
154154
"""
155155
Argument validation for distribution args
@@ -174,7 +174,7 @@ def _validate_args(
174174
return is_variable
175175

176176
def _to_tensor(
177-
self, *args: TensorLike | NestedNumbericSequence
177+
self, *args: TensorLike | NestedNumericSequence
178178
) -> tuple[Tensor, ...]:
179179
"""
180180
Argument convert args to Tensor
@@ -308,7 +308,7 @@ def _logits_to_probs(
308308
)
309309

310310
def _broadcast_all(
311-
self, *args: TensorLike | NestedNumbericSequence
311+
self, *args: TensorLike | NestedNumericSequence
312312
) -> tuple[Tensor, ...]:
313313
r"""
314314
Returns a list where each arg is broadcasted. Scalar args are upcast to tensors

python/paddle/nn/functional/pooling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ def max_pool1d(
640640
padding, 1, ceil_mode=ceil_mode
641641
)
642642

643-
# use 2d to implenment 1d should expand padding in advance.
643+
# use 2d to implement 1d should expand padding in advance.
644644
padding = _expand_low_nd_padding(padding)
645645

646646
if in_dynamic_or_pir_mode():
@@ -831,7 +831,7 @@ def max_unpool1d(
831831
else:
832832
stride = [1, *convert_to_list(stride, 1, 'pool_stride')]
833833
padding, padding_algorithm = _update_padding_nd(padding, 1)
834-
# use 2d to implenment 1d should expand padding in advance.
834+
# use 2d to implement 1d should expand padding in advance.
835835
padding = _expand_low_nd_padding(padding)
836836

837837
if output_size is not None:

python/paddle/nn/layer/activation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class GELU(Layer):
189189
GELU(x) = 0.5 * x * (1 + erf(\frac{x}{\sqrt{2}}))
190190
191191
Parameters:
192-
approximate (bool, optional): Wether to enable approximation. Default is False.
192+
approximate (bool, optional): Whether to enable approximation. Default is False.
193193
name (str|None, optional): Name for the operation (optional, default is None).
194194
For more information, please refer to :ref:`api_guide_Name`.
195195
@@ -1190,7 +1190,7 @@ class ThresholdedReLU(Layer):
11901190
11911191
Parameters:
11921192
threshold (float, optional): The value of threshold for ThresholdedReLU. Default is 1.0
1193-
value (float, optinal): The value to replace with when x is less than threshold. Default is 0.0
1193+
value (float, optional): The value to replace with when x is less than threshold. Default is 0.0
11941194
name (str|None, optional): Name for the operation (optional, default is None).
11951195
For more information, please refer to :ref:`api_guide_Name`.
11961196

python/paddle/sparse/binary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def mask_as(x: Tensor, mask: Tensor, name: str | None = None) -> Tensor:
506506
Filter the input dense tensor `x` using the `indices` of the sparse matrix `mask`,
507507
which in turn generates a sparse matrix of the corresponding format.
508508
The input `x` and `mask` must have the same shape, and the sparse tensor returned has the same indices as `mask`
509-
even `zero` values exist in the coresponding indices.
509+
even `zero` values exist in the corresponding indices.
510510
511511
Args:
512512
x (Tensor): The input tensor. It should be a DenseTensor.

python/paddle/sparse/creation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import numpy.typing as npt
3636

3737
from paddle import CPUPlace, CUDAPinnedPlace, CUDAPlace, Tensor
38-
from paddle._typing import DTypeLike, NumbericSequence, ShapeLike
38+
from paddle._typing import DTypeLike, NumericSequence, ShapeLike
3939

4040
__all__ = [
4141
'sparse_coo_tensor',
@@ -87,7 +87,7 @@ def sparse_coo_tensor(
8787
| npt.NDArray[np.int_]
8888
| Tensor
8989
),
90-
values: NumbericSequence | npt.NDArray[Any] | Tensor,
90+
values: NumericSequence | npt.NDArray[Any] | Tensor,
9191
shape: ShapeLike | None = None,
9292
dtype: DTypeLike | None = None,
9393
place: CPUPlace | CUDAPinnedPlace | CUDAPlace | str | None = None,
@@ -220,7 +220,7 @@ def _infer_dense_csr_shape(crows, cols):
220220
def sparse_csr_tensor(
221221
crows: list[int] | tuple[int, ...] | npt.NDArray[np.int_] | Tensor,
222222
cols: list[int] | tuple[int, ...] | npt.NDArray[np.int_] | Tensor,
223-
values: NumbericSequence | npt.NDArray[Any] | Tensor,
223+
values: NumericSequence | npt.NDArray[Any] | Tensor,
224224
shape: ShapeLike | None = None,
225225
dtype: DTypeLike | None = None,
226226
place: CPUPlace | CUDAPinnedPlace | CUDAPlace | str | None = None,

0 commit comments

Comments
 (0)