Skip to content

Commit 601e7dc

Browse files
kiszkpytorchmergebot
authored andcommitted
Fix typos under caffe2/operators directory (pytorch#98235)
This PR fixes typos in comments and messages of `.cc` and `.h` files under `caffe2/operators` directory Pull Request resolved: pytorch#98235 Approved by: https://github.com/kit1980
1 parent feb9ec4 commit 601e7dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+58
-58
lines changed

caffe2/operators/async_net_barrier_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ OPERATOR_SCHEMA(AsyncNetBarrier)
3333
.DeviceInferenceFunction(asyncBarrierOpDevInfer)
3434
.SetDoc(R"DOC(
3535
This is a pretty much no-op operator, since it's only purposes is make sure that
36-
async_scheduling will schedule certian operations earlier than others.
36+
async_scheduling will schedule certain operations earlier than others.
3737
3838
Exaple where this operator can work well - mixture of data-parallel and model-
3939
parallel training, where one wants to force that all copies are started before

caffe2/operators/async_net_barrier_op.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AsyncNetBarrierOp : public Operator<Context> {
1515

1616
bool RunOnDevice() override {
1717
// This is a pretty much no-op operator, since it's only purposes is make
18-
// sure that async_scheduling will schedule certian operations earlier than
18+
// sure that async_scheduling will schedule certain operations earlier than
1919
// others.
2020
//
2121
// Exaple where this operator can work well - mixture of data-parallel and

caffe2/operators/batch_bucketize_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ after running this operator.
117117
"Flatten tensor, dimension has to match the sum of lengths")
118118
.Output(
119119
0,
120-
"bucktized_feat",
120+
"bucketized_feat",
121121
"2-D dense tensor, with 1st dim = float_features.dim(0), 2nd dim = size(indices)"
122122
"in the arg list, the tensor is of the same data type as `feature`.");
123123

caffe2/operators/bbox_transform_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Transform proposal bounding boxes to target bounding box using bounding box
5252
"If proposals from multiple images in a batch are present, they "
5353
"should be grouped sequentially and in incremental order."
5454
"For rotated boxes, this would have an additional angle (in degrees) "
55-
"in the format [<optionaal_batch_id>, ctr_x, ctr_y, w, h, angle].")
55+
"in the format [<optional_batch_id>, ctr_x, ctr_y, w, h, angle].")
5656
.Input(
5757
1,
5858
"deltas",

caffe2/operators/bisect_percentile_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ OPERATOR_SCHEMA(BisectPercentile)
1515
1616
For each feature, we also need additional information regarding the feature
1717
value distribution.
18-
There are several vectors to keep data to percentile mappping information
18+
There are several vectors to keep data to percentile mapping information
1919
as arguments (context):
2020
1. feature raw values (R)
2121
2. feature percentile mapping (P)

caffe2/operators/box_with_nms_limit_op.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ returned boxes.
262262
)DOC")
263263
.Arg("score_thresh", "(float) TEST.SCORE_THRESH")
264264
.Arg("nms", "(float) TEST.NMS")
265-
.Arg("detections_per_im", "(int) TEST.DEECTIONS_PER_IM")
265+
.Arg("detections_per_im", "(int) TEST.DETECTIONS_PER_IM")
266266
.Arg("soft_nms_enabled", "(bool) TEST.SOFT_NMS.ENABLED")
267267
.Arg("soft_nms_method", "(string) TEST.SOFT_NMS.METHOD")
268268
.Arg("soft_nms_sigma", "(float) TEST.SOFT_NMS.SIGMA")
@@ -280,7 +280,7 @@ returned boxes.
280280
"boxes",
281281
"Bounding box for each class, size (count, num_classes * 4). "
282282
"For rotated boxes, this would have an additional angle (in degrees) "
283-
"in the format [<optionaal_batch_id>, ctr_x, ctr_y, w, h, angle]. "
283+
"in the format [<optional_batch_id>, ctr_x, ctr_y, w, h, angle]. "
284284
"Size: (count, num_classes * 5).")
285285
.Input(
286286
2,

caffe2/operators/conv_transpose_op_impl.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ bool ConvTransposeOp<T, Context>::RunOnDeviceWithOrderNCHW() {
4646
ConvTransposeUnpoolBase<Context>::GetOutputSize(X, C);
4747
auto* Y = Output(0, Y_dims, at::dtype<T>());
4848
if (X.numel() == 0) {
49-
VLOG(2) << "Number of elements is 0 in ConvTrasposeOp";
49+
VLOG(2) << "Number of elements is 0 in ConvTransposeOp";
5050
return true;
5151
}
5252

@@ -200,7 +200,7 @@ bool ConvTransposeOp<T, Context>::RunOnDeviceWithOrderNHWC() {
200200
ConvTransposeUnpoolBase<Context>::GetOutputSize(X, C);
201201
auto* Y = Output(0, Y_dims, at::dtype<T>());
202202
if (X.numel() == 0) {
203-
VLOG(2) << "Number of elements is 0 in ConvTrasposeOp";
203+
VLOG(2) << "Number of elements is 0 in ConvTransposeOp";
204204
return true;
205205
}
206206

@@ -361,7 +361,7 @@ bool ConvTransposeGradientOp<T, Context>::RunOnDeviceWithOrderNCHW() {
361361
math::Set<T, Context>(filter.numel(), T(0), dfilter_data, &context_);
362362

363363
if (X.numel() == 0) {
364-
VLOG(2) << "Number of elements is 0 in ConvTrasposeOp";
364+
VLOG(2) << "Number of elements is 0 in ConvTransposeOp";
365365
if (dbias_data != nullptr) {
366366
math::Set<T, Context>(C, T(0), dbias_data, &context_);
367367
}
@@ -526,7 +526,7 @@ bool ConvTransposeGradientOp<T, Context>::RunOnDeviceWithOrderNHWC() {
526526
math::Set<T, Context>(filter.numel(), T(0), dfilter_data, &context_);
527527

528528
if (X.numel() == 0) {
529-
VLOG(2) << "Number of elements is 0 in ConvTrasposeOp";
529+
VLOG(2) << "Number of elements is 0 in ConvTransposeOp";
530530
if (dbias_data != nullptr) {
531531
math::Set<T, Context>(C, T(0), dbias_data, &context_);
532532
}

caffe2/operators/conv_transpose_op_mobile.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ConvTransposeMobileOp final : public ConvTransposeUnpoolBase<Context> {
3131
bool RunOnDeviceWithOrderNHWC() override;
3232

3333
private:
34-
// We store a numThreasds per-worker tiles of Y, and numThreads per-worker
34+
// We store a numThreads per-worker tiles of Y, and numThreads per-worker
3535
// threadBuffer for the gemm output, laid out in that order.
3636
Tensor threadBuffer_{CPU};
3737

caffe2/operators/conv_transpose_op_mobile_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ bool ConvTransposeMobileOp<T, Context>::RunOnDeviceWithOrderNCHW() {
552552
Tensor* Y = Output(0, sizes, at::dtype<T>());
553553

554554
if (X.numel() == 0) {
555-
VLOG(2) << "Number of elements is 0 in ConvTrasposeOp";
555+
VLOG(2) << "Number of elements is 0 in ConvTransposeOp";
556556
return true;
557557
}
558558

caffe2/operators/crf_viterbi_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ViterbiPathOp : public Operator<CPUContext> {
8282

8383
CAFFE_ENFORCE(
8484
predictions.dim() == 2 && transitions.dim() == 2,
85-
"Predictions and transitions hould 2D matrices");
85+
"Predictions and transitions hold 2D matrices");
8686

8787
CAFFE_ENFORCE(
8888
predictions.size(1) == transitions.size(0),

caffe2/operators/data_couple.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ OPERATOR_SCHEMA(DataCouple)
88
.SetDoc(R"DOC(
99
1010
A one to one operator that takes an arbitrary number of input and output blobs
11-
such that each input blob is inplace with it's matching output blob. It then proceedes
11+
such that each input blob is inplace with it's matching output blob. It then proceeds
1212
to do nothing with each of these operators. This serves two purposes. It can make it
1313
appear as if a blob has been written to, as well as can tie together different blobs
1414
in a data dependency

caffe2/operators/dataset_ops.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ class CollectTensorOp final : public Operator<Context> {
10301030
CAFFE_ENFORCE(
10311031
// NOLINTNEXTLINE(clang-diagnostic-sign-compare)
10321032
tensorVector->size() == numToCollect_,
1033-
"TensorVecotor size = ",
1033+
"TensorVector size = ",
10341034
tensorVector->size(),
10351035
" is different from numToCollect = ",
10361036
numToCollect_);

caffe2/operators/dataset_ops.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class TreeCursor {
9292

9393
/**
9494
* Simple wrapper class allowing an easy traversal of the tensors representing
95-
* the hirerarchical structure.
95+
* the hierarchical structure.
9696
*/
9797
class TreeWalker {
9898
public:

caffe2/operators/fused_rowwise_random_quantization_ops.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bool FloatToFusedRandRowwiseQuantizedOp<Context>::RunOnDevice() {
2929
// quantized data in one byte, the last buckets of some bytes may have
3030
// unused bits. There are totally tail buckets are unused.
3131
// We encode *bitwidth* and *tail* at the beginning of
32-
// each row, following by 32-bit floating data respresenting min and max.
32+
// each row, following by 32-bit floating data representing min and max.
3333
// | bitwidth | tail | min | max | ... int8 data ... |
3434
// | 1B | 1B | 4B | 4B | ...output_data....|
3535
// In output_data: the b-th bucket of the i-th byte stores

caffe2/operators/gather_ranges_to_dense_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ are sorted by the corresponding KEY.
7272
"min_observation",
7373
"The number of observations needed before deciding that the ratio of "
7474
"mismatched ranges is alarming, also determines whether an info "
75-
"sumarizing the empty and mismatch ratio will be printed at the end.")
75+
"summarizing the empty and mismatch ratio will be printed at the end.")
7676
.Arg(
7777
"max_mismatched_ratio",
7878
"An error is raised when ratio of mismatched ranges exceeds this.")

caffe2/operators/gather_ranges_to_dense_op.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class GatherRangesToDenseOp final : public Operator<Context> {
128128
continue;
129129
}
130130
if (rangeLength != lengths_[j]) {
131-
// Range lengths missmatch for output #, will be filled with zeros
131+
// Range lengths mismatch for output #, will be filled with zeros
132132
// Note, empty ranges are not counted as mismatched because empty
133133
// are more common and more tolerable.
134134
mismatchedRanges_[j]++;
@@ -227,7 +227,7 @@ class GatherRangesToDenseOp final : public Operator<Context> {
227227
vector<set<int>> mismatchedLengths_;
228228
// To avoid false alarm due to insufficient sample (e.g., first batch being
229229
// mismatched and causing 100% to be mismatched), use a threshold to ensure
230-
// enough samples are gathered before decideding whether there is an alarm or
230+
// enough samples are gathered before deciding whether there is an alarm or
231231
// not.
232232
int64_t minObservation_ = 0;
233233
float maxMismatchedRatio_ = 0;

caffe2/operators/generate_proposals_op.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ ERMatXf ComputeAllAnchors(
8181
ConstEigenVectorMap<float>(shift_zero.data(), shift_zero.size());
8282
}
8383

84-
// Broacast anchors over shifts to enumerate all anchors at all positions
84+
// Broadcast anchors over shifts to enumerate all anchors at all positions
8585
// in the (H, W) grid:
8686
// - add A anchors of shape (1, A, box_dim) to
8787
// - K shifts of shape (K, 1, box_dim) to get
@@ -370,7 +370,7 @@ OPERATOR_SCHEMA(GenerateProposals)
370370
.NumInputs(4)
371371
.NumOutputs(2)
372372
.SetDoc(R"DOC(
373-
Generate bounding box proposals for Faster RCNN. The propoasls are generated for
373+
Generate bounding box proposals for Faster RCNN. The proposals are generated for
374374
a list of images based on image score 'score', bounding box regression result
375375
'deltas' as well as predefined bounding box shapes 'anchors'. Greedy
376376
non-maximum suppression is applied to generate the final bounding boxes.

caffe2/operators/generate_proposals_op_util_boxes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const float PI = 3.14159265358979323846;
2727
// weights: weights [wx, wy, ww, wh] for the deltas
2828
// bbox_xform_clip: minimum bounding box width and height in log-space after
2929
// transofmration
30-
// correct_transform_coords: Correct bounding box transform coordates. Set to
30+
// correct_transform_coords: Correct bounding box transform coordinates. Set to
3131
// true to match the detectron code, set to false for backward compatibility
3232
// return: pixel coordinates of the bounding boxes
3333
// size (M, 4), format [x1; y1; x2; y2]

caffe2/operators/generate_proposals_op_util_nms.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ int rotated_rect_intersection_pts(
242242
rect1.get_vertices(pts1);
243243
rect2.get_vertices(pts2);
244244

245-
// Specical case of rect1 == rect2
245+
// Special case of rect1 == rect2
246246
bool same = true;
247247

248248
for (const auto i : c10::irange(4)) {

caffe2/operators/h_softmax_op.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ bool HuffmanTreeHierarchyOp<T, Context>::RunOnDevice() {
484484
nodes.push(node);
485485
};
486486

487-
// Main loop for buttom up huffman tree construction.
487+
// Main loop for bottom up huffman tree construction.
488488
while (!nodes.empty()) {
489489
auto lNode = get_next_node();
490490
if (!nodes.empty()) {
@@ -626,7 +626,7 @@ search tree.
626626
.Arg(
627627
"tree",
628628
"Serialized TreeProto string containing a tree "
629-
"including all intermidate nodes and leafs. All nodes must have names "
629+
"including all intermediate nodes and leafs. All nodes must have names "
630630
"for correct outputs")
631631
.Arg(
632632
"beam",

caffe2/operators/heatmap_max_keypoint_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ bool HeatmapMaxKeypointOp<float, CPUContext>::RunOnDevice() {
9898
ERArrXXf fmax = ERArrXXf::Zero(3, 3);
9999

100100
// initialize fmax values of local 3x3 grid
101-
// when 3x3 grid going out-of-bound, mirrowing around center
101+
// when 3x3 grid going out-of-bound, mirroring around center
102102
for (int y = -1; y <= 1; y++) {
103103
for (int x = -1; x <= 1; x++) {
104104
int xx = x - 2 * (x + maxX >= heatmap_size) + 2 * (x + maxX < 0);

caffe2/operators/integral_image_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ template <>
1717
bool IntegralImageOp<float, CPUContext>::RunOnDevice() {
1818
const auto& X = Input(0);
1919

20-
CAFFE_ENFORCE_EQ(X.dim(), 4, "Only supports 4D tensors for the momement");
20+
CAFFE_ENFORCE_EQ(X.dim(), 4, "Only supports 4D tensors for the moment");
2121

2222
vector<int64_t> out_shape(X.sizes().vec());
2323
out_shape[2] += 1; // H + 1 output size

caffe2/operators/integral_image_op.cu

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ template <>
120120
bool IntegralImageOp<float, CUDAContext>::RunOnDevice() {
121121
auto& X = Input(0);
122122

123-
CAFFE_ENFORCE(X.dim() == 4, "Only supports 4D tensors for the momement");
123+
CAFFE_ENFORCE(X.dim() == 4, "Only supports 4D tensors for the moment");
124124

125125
// Input is (N, C, H, W)
126126
// Output is (N, C, H + 1, W + 1)

caffe2/operators/last_n_window_collector.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ OPERATOR_SCHEMA(LastNWindowCollector)
171171
})
172172
.SetDoc(R"DOC(
173173
Collect the last N rows from input data. The purpose is to keep track of data
174-
accross batches, so for example suppose the LastNWindowCollector is called
174+
across batches, so for example suppose the LastNWindowCollector is called
175175
successively with the following input data
176176
177177
[1, 2, 3, 4]

caffe2/operators/lengths_reducer_ops.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class TTSparseLengthsSumOp final : public Operator<Context> {
307307
const vector<int64_t>& ind_slice,
308308
int bs,
309309
int idx) {
310-
// implement the functinality index_select(core, 1, ind_slice)
310+
// implement the functionality index_select(core, 1, ind_slice)
311311
auto num_of_elements = ranks[idx] * factor_j[idx] * ranks[idx + 1];
312312
for (const auto i : c10::irange(bs)) {
313313
memcpy(
@@ -495,7 +495,7 @@ class TTSparseLengthsSumGradientOp final : public Operator<Context> {
495495
~TTSparseLengthsSumGradientOp() {}
496496
};
497497

498-
// implement the graident op for TTLengthSumGradient op
498+
// implement the gradient op for TTLengthSumGradient op
499499
template <typename T, class Context>
500500
bool TTSparseLengthsSumGradientOp<T, Context>::RunOnDevice() {
501501
const auto& core0 = Input(0);
@@ -646,7 +646,7 @@ bool TTSparseLengthsSumGradientOp<T, Context>::RunOnDevice() {
646646
&context_);
647647

648648
// =======================================================
649-
// Calcuate dCore1_data:
649+
// Calculate dCore1_data:
650650
// 1) Transpose core1_out_grad and multiply with core0_out
651651
// 2) Transpose the result and then add to dCore1_data
652652
vector<vector<T>> dCore1_data_slice_grad(
@@ -688,7 +688,7 @@ bool TTSparseLengthsSumGradientOp<T, Context>::RunOnDevice() {
688688
sizeof(T) * num_of_elements);
689689
}
690690

691-
// Calcuate core0_out_grad
691+
// Calculate core0_out_grad
692692
vector<vector<T>> core0_out_grad(
693693
bs, vector<T>(core0_out_shape[1] * core0_out_shape[2], 0));
694694

caffe2/operators/load_save_op.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class CheckpointOp final : public Operator<Context> {
394394
CAFFE_ENFORCE_GT(every_, 0, "Checkpoint interval should be positive.");
395395
if (every_ == 1) {
396396
// Just issue a warning, but it's totally legal so we don't do anything.
397-
LOG(WARNING) << "It seems that we are checkpointting every iteration. "
397+
LOG(WARNING) << "It seems that we are checkpointing every iteration. "
398398
<< "Is that intended?";
399399
}
400400
save_op_def_.set_type("Save");

caffe2/operators/lpnorm_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ supports l1 and l2 norm) determined by the argument p.
152152
.Arg("p", "Order of the norm in p-norm")
153153
.Arg(
154154
"average",
155-
"whehther we calculate norm or averaged_norm."
155+
"whether we calculate norm or averaged_norm."
156156
"The Lp_averaged_norm(x) is defined as"
157157
"Lp_averaged_normgradient(x) = LpNormGradient(x) / size(x)");
158158

caffe2/operators/negate_gradient_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ OPERATOR_SCHEMA(NegateGradient)
88
.NumOutputs(1)
99
.AllowInplace({{0, 0}})
1010
.SetDoc(R"DOC(
11-
NegagteGradient operator in forward pass simply copies input to the
11+
NegateGradient operator in forward pass simply copies input to the
1212
output, and in backward pass, flips the sign of the output gradient
1313
)DOC");
1414

caffe2/operators/prefetch_op.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PrefetchOperator : public OperatorBase {
3737

3838
virtual ~PrefetchOperator() noexcept {
3939
CHECK(finalize_ || !prefetch_thread_.get())
40-
<< "YOU MADE A PROGRAMING ERROR: derived class of PrefetchOperator "
40+
<< "YOU MADE A PROGRAMMING ERROR: derived class of PrefetchOperator "
4141
"should call Finalize() in its destructor so the prefetching "
4242
"thread is joined. ";
4343
}

caffe2/operators/quantized/int8_roi_align_op.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ Region of Interest (RoI) align operation as used in Mask R-CNN.
4040
"Y",
4141
"4D Int8 Tensor output of shape (R, C, pooled_h, pooled_w). "
4242
"The r-th batch element "
43-
"is a pooled feature map cooresponding to the r-th RoI.");
43+
"is a pooled feature map corresponding to the r-th RoI.");
4444

4545
} // namespace caffe2

caffe2/operators/quantized/int8_roi_align_op.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void pre_calc_for_bilinear_interpolate(
110110
uint8_t w3 = static_cast<uint8_t>(Round(ly * hx * w_multiplier));
111111
uint8_t w4 = static_cast<uint8_t>(Round(ly * lx * w_multiplier));
112112

113-
// save weights and indeces
113+
// save weights and indices
114114
PreCalc pc;
115115
pc.pos1 = y_low * width + x_low;
116116
pc.pos2 = y_low * width + x_high;
@@ -203,8 +203,8 @@ void ROIAlignForward(
203203
int Y_shift;
204204
QuantizeMultiplierSmallerThanOne(real_multiplier, &Y_multiplier, &Y_shift);
205205

206-
// we want to precalculate indeces and weights shared by all chanels,
207-
// this is the key point of optimiation
206+
// we want to precalculate indices and weights shared by all channels,
207+
// this is the key point of optimization
208208
std::vector<PreCalc> pre_calc(
209209
roi_bin_grid_h * roi_bin_grid_w * pooled_width * pooled_height);
210210
pre_calc_for_bilinear_interpolate(

0 commit comments

Comments
 (0)