Skip to content

Commit 4b2e90d

Browse files
authored
Fix minimun minimum (#60920)
1 parent e0d6eb1 commit 4b2e90d

File tree

14 files changed

+89
-89
lines changed

14 files changed

+89
-89
lines changed

python/paddle/sparse/creation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def sparse_coo_tensor(
155155
shape = list(shape)
156156
if shape < min_shape:
157157
raise ValueError(
158-
f"the minimun shape required is {min_shape}, but get {shape}"
158+
f"the minimum shape required is {min_shape}, but get {shape}"
159159
)
160160
if len(shape) != sparse_dim + dense_dim:
161161
raise ValueError(
@@ -188,7 +188,7 @@ def sparse_csr_tensor(
188188
r"""
189189
Constructs a sparse ``paddle.Tensor`` in CSR(Compressed Sparse Row) format according to the
190190
``crows``, ``cols`` and ``values``.
191-
Currently, the crows and cols of each batch must be incrementd.
191+
Currently, the crows and cols of each batch must be incremented.
192192
193193
Args:
194194
crows(list|tuple|ndarray|Tensor): 1-D array, each element in the rows represents the

python/paddle/sparse/nn/layer/activation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Softmax(Layer):
7272
Only support axis=-1 for SparseCsrTensor, which is faster when read data
7373
by row (axis=-1).
7474
75-
Transform x to dense matix, and :math:`i` is row index, :math:`j` is column index.
75+
Transform x to dense matrix, and :math:`i` is row index, :math:`j` is column index.
7676
If axis=-1, We have:
7777
7878
.. math::

python/paddle/sparse/nn/layer/conv.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def extra_repr(self):
238238

239239
class Conv3D(_Conv3D):
240240
r"""
241-
**Sparse Convlution3d Layer**
241+
**Sparse Convolution3d Layer**
242242
The Sparse convolution3d layer calculates the output based on the input, filter
243243
and strides, paddings, dilations, groups parameters. Input(Input) and
244244
Output(Output) are multidimensional SparseCooTensors with a shape of
@@ -267,11 +267,11 @@ class Conv3D(_Conv3D):
267267
stride(int|list|tuple, optional): The stride size. If stride is a list/tuple, it must
268268
contain three integers, (stride_D, stride_H, stride_W). Otherwise, the
269269
stride_D = stride_H = stride_W = stride. The default value is 1.
270-
padding(int|str|tuple|list, optional): The padding size. Padding coule be in one of the following forms.
270+
padding(int|str|tuple|list, optional): The padding size. Padding couple be in one of the following forms.
271271
1. a string in ['valid', 'same'].
272-
2. an int, which means each spartial dimension(depth, height, width) is zero paded by size of `padding`
273-
3. a list[int] or tuple[int] whose length is the number of spartial dimensions, which contains the amount of padding on each side for each spartial dimension. It has the form [pad_d1, pad_d2, ...].
274-
4. a list[int] or tuple[int] whose length is 2 * number of spartial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spartial dimensions.
272+
2. an int, which means each spatial dimension(depth, height, width) is zero padded by size of `padding`
273+
3. a list[int] or tuple[int] whose length is the number of spatial dimensions, which contains the amount of padding on each side for each spatial dimension. It has the form [pad_d1, pad_d2, ...].
274+
4. a list[int] or tuple[int] whose length is 2 * number of spatial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spatial dimensions.
275275
5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
276276
The default value is 0.
277277
dilation(int|list|tuple, optional): The dilation size. If dilation is a list/tuple, it must
@@ -373,7 +373,7 @@ def __init__(
373373

374374
class Conv2D(_Conv2D):
375375
r"""
376-
**Sparse Convlution2d Layer**
376+
**Sparse Convolution2d Layer**
377377
378378
The Sparse convolution2d layer calculates the output based on the input, filter
379379
and strides, paddings, dilations, groups parameters. Input(Input) and
@@ -403,12 +403,12 @@ class Conv2D(_Conv2D):
403403
stride(int|list|tuple, optional): The stride size. If stride is a list/tuple, it must
404404
contain three integers, (stride_H, stride_W). Otherwise, the
405405
stride_H = stride_W = stride. The default value is 1.
406-
padding(int|str|tuple|list, optional): The padding size. Padding coule be in one of the following forms.
406+
padding(int|str|tuple|list, optional): The padding size. Padding couple be in one of the following forms.
407407
408408
1. a string in ['valid', 'same'].
409-
2. an int, which means each spartial dimension(height, width) is zero paded by size of `padding`
410-
3. a list[int] or tuple[int] whose length is the number of spartial dimensions, which contains the amount of padding on each side for each spartial dimension. It has the form [pad_d1, pad_d2, ...].
411-
4. a list[int] or tuple[int] whose length is 2 * number of spartial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spartial dimensions.
409+
2. an int, which means each spatial dimension(height, width) is zero padded by size of `padding`
410+
3. a list[int] or tuple[int] whose length is the number of spatial dimensions, which contains the amount of padding on each side for each spatial dimension. It has the form [pad_d1, pad_d2, ...].
411+
4. a list[int] or tuple[int] whose length is 2 * number of spatial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spatial dimensions.
412412
5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...].
413413
414414
Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
@@ -508,7 +508,7 @@ def __init__(
508508

509509
class SubmConv3D(_Conv3D):
510510
r"""
511-
**Submanifold Sparse Convlution3d Layer**
511+
**Submanifold Sparse Convolution3d Layer**
512512
The submanifold sparse convolution3d layer calculates the output based on the input, filter
513513
and strides, paddings, dilations, groups parameters. Input(Input) and
514514
Output(Output) are multidimensional SparseCooTensors with a shape of
@@ -537,11 +537,11 @@ class SubmConv3D(_Conv3D):
537537
stride(int|list|tuple, optional): The stride size. If stride is a list/tuple, it must
538538
contain three integers, (stride_D, stride_H, stride_W). Otherwise, the
539539
stride_D = stride_H = stride_W = stride. The default value is 1.
540-
padding(int|str|tuple|list, optional): The padding size. Padding coule be in one of the following forms.
540+
padding(int|str|tuple|list, optional): The padding size. Padding couple be in one of the following forms.
541541
1. a string in ['valid', 'same'].
542-
2. an int, which means each spartial dimension(depth, height, width) is zero paded by size of `padding`
543-
3. a list[int] or tuple[int] whose length is the number of spartial dimensions, which contains the amount of padding on each side for each spartial dimension. It has the form [pad_d1, pad_d2, ...].
544-
4. a list[int] or tuple[int] whose length is 2 * number of spartial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spartial dimensions.
542+
2. an int, which means each spatial dimension(depth, height, width) is zero padded by size of `padding`
543+
3. a list[int] or tuple[int] whose length is the number of spatial dimensions, which contains the amount of padding on each side for each spatial dimension. It has the form [pad_d1, pad_d2, ...].
544+
4. a list[int] or tuple[int] whose length is 2 * number of spatial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spatial dimensions.
545545
5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
546546
The default value is 0.
547547
dilation(int|list|tuple, optional): The dilation size. If dilation is a list/tuple, it must
@@ -648,7 +648,7 @@ def __init__(
648648

649649
class SubmConv2D(_Conv2D):
650650
r"""
651-
**Submanifold Sparse Convlution2d Layer**
651+
**Submanifold Sparse Convolution2d Layer**
652652
653653
The submanifold sparse convolution2d layer calculates the output based on the input, filter
654654
and strides, paddings, dilations, groups parameters. Input(Input) and
@@ -678,12 +678,12 @@ class SubmConv2D(_Conv2D):
678678
stride(int|list|tuple, optional): The stride size. If stride is a list/tuple, it must
679679
contain two integers, (stride_H, stride_W). Otherwise, the
680680
stride_H = stride_W = stride. The default value is 1.
681-
padding(int|str|tuple|list, optional): The padding size. Padding coule be in one of the following forms.
681+
padding(int|str|tuple|list, optional): The padding size. Padding couple be in one of the following forms.
682682
683683
1. a string in ['valid', 'same'].
684-
2. an int, which means each spartial dimension(depth, height, width) is zero paded by size of `padding`
685-
3. a list[int] or tuple[int] whose length is the number of spartial dimensions, which contains the amount of padding on each side for each spartial dimension. It has the form [pad_d1, pad_d2, ...].
686-
4. a list[int] or tuple[int] whose length is 2 * number of spartial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spartial dimensions.
684+
2. an int, which means each spatial dimension(depth, height, width) is zero padded by size of `padding`
685+
3. a list[int] or tuple[int] whose length is the number of spatial dimensions, which contains the amount of padding on each side for each spatial dimension. It has the form [pad_d1, pad_d2, ...].
686+
4. a list[int] or tuple[int] whose length is 2 * number of spatial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spatial dimensions.
687687
5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...].
688688
689689
Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).

python/paddle/sparse/nn/layer/norm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
260260
epsilon(float, optional): The small value added to the variance to prevent division by zero. Default: 1e-5.
261261
momentum(float, optional): The value used for the moving_mean and moving_var computation. Default: 0.9.
262262
weight_attr(ParamAttr|bool, optional): The parameter attribute for Parameter `scale`
263-
of this layer. If it is set to None or one attribute of ParamAttr, this layerr
263+
of this layer. If it is set to None or one attribute of ParamAttr, this layer
264264
will create ParamAttr as param_attr. If the Initializer of the param_attr
265265
is not set, the parameter is initialized with Xavier. If it is set to False,
266266
this layer will not have trainable scale parameter. Default: None.

python/paddle/sparse/unary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def slice(x, axes, starts, ends, name=None):
953953
``starts`` or ``ends`` such as :math:`-i`, it represents the reverse position of
954954
the axis :math:`i-1` (here 0 is the initial position).
955955
If the value passed to ``starts`` or ``ends`` is greater than the number of elements
956-
in the dimenstion (n), it represents n.
956+
in the dimension (n), it represents n.
957957
For slicing to the end of a dimension with unknown size, it is recommended to pass
958958
in INT_MAX. The size of ``axes`` must be equal to ``starts`` and ``ends``.
959959
@@ -1039,7 +1039,7 @@ def pca_lowrank(x, q=None, center=True, niter=2, name=None):
10391039
10401040
Args:
10411041
x (Tensor): The input tensor. Its shape should be `[N, M]`,
1042-
N and M can be arbitraty positive number.
1042+
N and M can be arbitrary positive number.
10431043
The data type of x should be float32 or float64.
10441044
q (int, optional): a slightly overestimated rank of :math:`X`.
10451045
Default value is :math:`q=min(6,N,M)`.

python/paddle/static/input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class InputSpec:
207207
def __init__(self, shape, dtype='float32', name=None, stop_gradient=False):
208208
# replace `None` in shape with -1
209209
self.shape = self._verify(shape)
210-
# convert dtype into united represention
210+
# convert dtype into united representation
211211
if dtype is not None:
212212
if isinstance(dtype, (np.dtype, str)):
213213
dtype = convert_np_dtype_to_dtype_(dtype)

python/paddle/static/io.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def normalize_program(program, feed_vars, fetch_vars, **kwargs):
197197
feed_vars(Tensor | list[Tensor]): Variables needed by inference.
198198
fetch_vars(Tensor | list[Tensor]): Variables returned by inference.
199199
kwargs: Supported keys including ``skip_prune_program``.
200-
- skip_prune_program(bool): whether to skip prunning program. Defaults to False.
200+
- skip_prune_program(bool): whether to skip pruning program. Defaults to False.
201201
202202
Returns:
203203
Program: Normalized/Optimized program.
@@ -211,7 +211,7 @@ def normalize_program(program, feed_vars, fetch_vars, **kwargs):
211211
212212
>>> path_prefix = "./infer_model"
213213
214-
# User defined network, here a softmax regession example
214+
# User defined network, here a softmax regression example
215215
>>> image = paddle.static.data(name='img', shape=[None, 28, 28], dtype='float32')
216216
>>> label = paddle.static.data(name='label', shape=[None, 1], dtype='int64')
217217
>>> predict = paddle.static.nn.fc(image, 10, activation='softmax')
@@ -283,10 +283,10 @@ def normalize_program(program, feed_vars, fetch_vars, **kwargs):
283283
# remove backward block
284284
copy_program.blocks.pop(backward_block_id)
285285
# update attrs ``blocks``
286-
reserverd_blocks = []
286+
reserved_blocks = []
287287
for block_id in sub_blocks_ids[:-1]:
288-
reserverd_blocks.append(copy_program.block(block_id))
289-
op._update_desc_attr("blocks", reserverd_blocks)
288+
reserved_blocks.append(copy_program.block(block_id))
289+
op._update_desc_attr("blocks", reserved_blocks)
290290

291291
for idx in remove_op_idx[::-1]:
292292
global_block._remove_op(idx)
@@ -332,7 +332,7 @@ def serialize_program(feed_vars, fetch_vars, **kwargs):
332332
333333
>>> path_prefix = "./infer_model"
334334
335-
# User defined network, here a softmax regession example
335+
# User defined network, here a softmax regression example
336336
>>> image = paddle.static.data(name='img', shape=[None, 28, 28], dtype='float32')
337337
>>> label = paddle.static.data(name='label', shape=[None, 1], dtype='int64')
338338
>>> predict = paddle.static.nn.fc(image, 10, activation='softmax')
@@ -391,7 +391,7 @@ def serialize_persistables(feed_vars, fetch_vars, executor, **kwargs):
391391
392392
>>> path_prefix = "./infer_model"
393393
394-
# User defined network, here a softmax regession example
394+
# User defined network, here a softmax regression example
395395
>>> image = paddle.static.data(name='img', shape=[None, 28, 28], dtype='float32')
396396
>>> label = paddle.static.data(name='label', shape=[None, 1], dtype='int64')
397397
>>> predict = paddle.static.nn.fc(image, 10, activation='softmax')
@@ -431,7 +431,7 @@ def _serialize_persistables(program, executor):
431431
"variables in your model to save"
432432
)
433433
return None
434-
# create a new program and clone persitable vars to it
434+
# create a new program and clone persistable vars to it
435435
save_program = Program()
436436
save_block = save_program.global_block()
437437
save_var_map = {}
@@ -543,7 +543,7 @@ def save_inference_model(
543543
544544
>>> path_prefix = "./infer_model"
545545
546-
# User defined network, here a softmax regession example
546+
# User defined network, here a softmax regression example
547547
>>> image = paddle.static.data(name='img', shape=[None, 28, 28], dtype='float32')
548548
>>> label = paddle.static.data(name='label', shape=[None, 1], dtype='int64')
549549
>>> predict = paddle.static.nn.fc(image, 10, activation='softmax')
@@ -644,7 +644,7 @@ def deserialize_program(data):
644644
645645
>>> path_prefix = "./infer_model"
646646
647-
# User defined network, here a softmax regession example
647+
# User defined network, here a softmax regression example
648648
>>> image = paddle.static.data(name='img', shape=[None, 28, 28], dtype='float32')
649649
>>> label = paddle.static.data(name='label', shape=[None, 1], dtype='int64')
650650
>>> predict = paddle.static.nn.fc(image, 10, activation='softmax')
@@ -693,7 +693,7 @@ def deserialize_persistables(program, data, executor):
693693
694694
>>> path_prefix = "./infer_model"
695695
696-
# User defined network, here a softmax regession example
696+
# User defined network, here a softmax regression example
697697
>>> image = paddle.static.data(name='img', shape=[None, 28, 28], dtype='float32')
698698
>>> label = paddle.static.data(name='label', shape=[None, 1], dtype='int64')
699699
>>> predict = paddle.static.nn.fc(image, 10, activation='softmax')
@@ -1620,7 +1620,7 @@ def load(program, model_path, executor=None, var_list=None):
16201620
program_var_list = program.list_vars()
16211621
program_var_name_set = {var.name for var in program_var_list}
16221622

1623-
# check all the variable inlcuded in program
1623+
# check all the variable included in program
16241624
for var in var_list:
16251625
if var.name not in program_var_name_set:
16261626
raise LookupError(
@@ -1804,7 +1804,7 @@ def set_program_state(program, state_dict):
18041804
unused_para_list.append(k)
18051805
if len(unused_para_list) > 0:
18061806
warnings.warn(
1807-
"This list is not set, Because of Paramerter not found in program. There are: {}".format(
1807+
"This list is not set, Because of Parameter not found in program. There are: {}".format(
18081808
" ".join(unused_para_list)
18091809
)
18101810
)

0 commit comments

Comments
 (0)