Skip to content

Commit 7af6d76

Browse files
co63oceee4017
authored andcommitted
Fix tenosr tensor (PaddlePaddle#61129)
* Fix * Fix
1 parent 7fa050f commit 7af6d76

8 files changed

Lines changed: 15 additions & 15 deletions

File tree

paddle/fluid/operators/detection/locality_aware_nms_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ threshold NMS based on parameters of nms_threshold and nms_eta.
495495
Aftern NMS step, at most keep_top_k number of total bboxes are to be kept
496496
per image if keep_top_k is larger than -1.
497497
This operator support multi-class and batched inputs. It applying NMS
498-
independently for each class. The outputs is a 2-D LoDTenosr, for each
498+
independently for each class. The outputs is a 2-D LoDTensor, for each
499499
image, the offsets in first dimension of phi::DenseTensor are called LoD, the number
500500
of offset is N + 1, where N is the batch size. If LoD[i + 1] - LoD[i] == 0,
501501
means there is no detected bbox for this image.

paddle/fluid/operators/detection/multiclass_nms_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ threshold NMS based on parameters of nms_threshold and nms_eta.
562562
Aftern NMS step, at most keep_top_k number of total bboxes are to be kept
563563
per image if keep_top_k is larger than -1.
564564
This operator support multi-class and batched inputs. It applying NMS
565-
independently for each class. The outputs is a 2-D LoDTenosr, for each
565+
independently for each class. The outputs is a 2-D LoDTensor, for each
566566
image, the offsets in first dimension of phi::DenseTensor are called LoD, the number
567567
of offset is N + 1, where N is the batch size. If LoD[i + 1] - LoD[i] == 0,
568568
means there is no detected bbox for this image.

paddle/fluid/operators/detection/retinanet_detection_output_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ threshold NMS based on parameters of nms_threshold and nms_eta.
648648
After NMS step, at most keep_top_k number of total bounding boxes are to be kept
649649
per image if keep_top_k is larger than -1.
650650
This operator support multi-class and batched inputs. It applying NMS
651-
independently for each class. The outputs is a 2-D LoDTenosr, for each
651+
independently for each class. The outputs is a 2-D LoDTensor, for each
652652
image, the offsets in first dimension of phi::DenseTensor are called LoD, the number
653653
of offset is N + 1, where N is the batch size. If LoD[i + 1] - LoD[i] == 0,
654654
means there is no detected bounding box for this image. If there is no detected boxes

paddle/phi/infermeta/binary.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ void DotInferMeta(const MetaTensor& x, const MetaTensor& y, MetaTensor* out) {
12791279
x_rank == static_cast<int>(y_dims.size()),
12801280
phi::errors::PreconditionNotMet(
12811281
"ShapeError: The shape of input tensor Y: %s should match with "
1282-
"input tenosr X: %s",
1282+
"input tensor X: %s",
12831283
y_dims.to_str(),
12841284
x_dims.to_str()));
12851285
bool shape_match = true;

paddle/phi/infermeta/spmd_rules/utils.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace distributed {
2727

2828
using phi::distributed::auto_parallel::str_join;
2929

30-
std::string GetBroadcastAxes(const int64_t& tenosr_ndim,
30+
std::string GetBroadcastAxes(const int64_t& tensor_ndim,
3131
const int64_t& broadcast_ndim,
3232
const std::string& alphabet) {
3333
PADDLE_ENFORCE_GE(
@@ -38,15 +38,15 @@ std::string GetBroadcastAxes(const int64_t& tenosr_ndim,
3838
alphabet.size(),
3939
broadcast_ndim));
4040
PADDLE_ENFORCE_GE(broadcast_ndim,
41-
tenosr_ndim,
41+
tensor_ndim,
4242
phi::errors::InvalidArgument(
43-
"The broadcast ndim [%d] is less than tenosr ndim [%d]",
43+
"The broadcast ndim [%d] is less than tensor ndim [%d]",
4444
broadcast_ndim,
45-
tenosr_ndim));
46-
if (tenosr_ndim <= 0) {
45+
tensor_ndim));
46+
if (tensor_ndim <= 0) {
4747
return std::string();
4848
}
49-
return alphabet.substr(broadcast_ndim - tenosr_ndim, tenosr_ndim);
49+
return alphabet.substr(broadcast_ndim - tensor_ndim, tensor_ndim);
5050
}
5151

5252
// Rule1: A repicated dimension could be merged by any sharded dimension.

paddle/phi/infermeta/spmd_rules/utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ inline bool IsEmpty(const std::vector<int64_t>& shape) {
3333
}
3434

3535
// Generate the axis notation of tensor for the einsum notation of a broadcast
36-
// operation(alignment star from the rightmost axis). tenosr_ndim: the size of
36+
// operation(alignment star from the rightmost axis). tensor_ndim: the size of
3737
// the tensor. broadcast_ndim: the maxium size of tensors in this broadcast
3838
// operation. alphabet: the characters used to represent the axes of tensor.
3939
// length of alphabet should >= broadcast_ndim.
40-
std::string GetBroadcastAxes(const int64_t& tenosr_ndim,
40+
std::string GetBroadcastAxes(const int64_t& tensor_ndim,
4141
const int64_t& broadcast_ndim,
4242
const std::string& alphabet);
4343

python/paddle/static/nn/sequence_lod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def sequence_pool(input, pool_type, is_test=False, pad_value=0.0):
314314
Args:
315315
input (variable): Tensor with lod_level no more than 2. The data type should be float32 or float64.
316316
pool_type (str): The pooling type that supports average, sum, sqrt, max, last or first.
317-
is_test (bool): Only works when :attr:`pool_type` is max. If set False, a temporary Tenosr maxIndex is
317+
is_test (bool): Only works when :attr:`pool_type` is max. If set False, a temporary Tensor maxIndex is
318318
created to record the index information corresponding to the maximum value, which is used for backward
319319
gradient calculation in the training phase. Default: False.
320320
pad_value (float): Used to pad the pooling result for empty input sequence. Default: 0.0

python/paddle/tensor/creation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,7 +2841,7 @@ def cauchy_(x, loc=0, scale=1, name=None):
28412841
"""Fills the tensor with numbers drawn from the Cauchy distribution.
28422842
28432843
Args:
2844-
x (Tenosr): the tensor will be filled, The data type is float32 or float64.
2844+
x (Tensor): the tensor will be filled, The data type is float32 or float64.
28452845
loc (scalar, optional): Location of the peak of the distribution. The data type is float32 or float64.
28462846
scale (scalar, optional): The half-width at half-maximum (HWHM). The data type is float32 or float64. Must be positive values.
28472847
name (str, optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None.
@@ -2875,7 +2875,7 @@ def geometric_(x, probs, name=None):
28752875
"""Fills the tensor with numbers drawn from the Geometric distribution.
28762876
28772877
Args:
2878-
x (Tenosr): the tensor will be filled, The data type is float32 or float64.
2878+
x (Tensor): the tensor will be filled, The data type is float32 or float64.
28792879
probs (Real|Tensor): Probability parameter.
28802880
The value of probs must be positive. When the parameter is a tensor, probs is probability of success for each trial.
28812881
name (str, optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None.

0 commit comments

Comments
 (0)