Skip to content

Commit 9322601

Browse files
authored
pre-commit: enable codespell; fix typos and cryptic names (#9019)
1 parent e58aa4e commit 9322601

File tree

141 files changed

+270
-255
lines changed

Some content is hidden

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

141 files changed

+270
-255
lines changed

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ repos:
4747
| \.xcassets/
4848
)
4949
50+
- repo: https://github.com/codespell-project/codespell
51+
rev: v2.4.1
52+
hooks:
53+
- id: codespell
54+
args: [ --ignore-words-list, "CreateOr,implementors,PADD,re-use,re-used,re-using,subtile,subtiles" ]
55+
exclude: |
56+
(?x)(
57+
^src/autoschedulers/common/cmdline\.h$
58+
| ^src/runtime/hexagon_remote/bin/src/
59+
| ^src/runtime/mini_cuda\.h$
60+
| ^src/runtime/mini_d3d12\.h$
61+
| ^apps/HelloAndroid.*/gradlew\.bat$
62+
| \.pgm$
63+
)
64+
5065
- repo: https://github.com/gitleaks/gitleaks
5166
rev: v8.9.0
5267
hooks:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ $(FILTERS_DIR)/nested_externs_%.a: $(BIN_DIR)/nested_externs.generator
17451745
$(CURDIR)/$< -g nested_externs_$* $(GEN_AOT_OUTPUTS) -o $(CURDIR)/$(FILTERS_DIR) target=$(TARGET)-no_runtime-user_context-c_plus_plus_name_mangling
17461746

17471747
# Similarly, gpu_multi needs two different kernels to test compilation caching.
1748-
# Also requies user-context.
1748+
# Also requires user-context.
17491749
$(FILTERS_DIR)/gpu_multi_context_threaded_%.a: $(BIN_DIR)/gpu_multi_context_threaded.generator
17501750
@mkdir -p $(@D)
17511751
$(CURDIR)/$< -g gpu_multi_context_threaded_$* $(GEN_AOT_OUTPUTS) -o $(CURDIR)/$(FILTERS_DIR) target=$(TARGET)-no_runtime-user_context

apps/HelloAndroid/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ In order to build, the following will be required:
2626
PATH.
2727

2828
If everything is setup correctly, running the build.sh script in this directory,
29-
with the current directory set to here, whould build the HelloAndroid apk and
29+
with the current directory set to here, would build the HelloAndroid apk and
3030
install it on a connected Android device.
3131

3232
# Gradle

apps/HelloAndroidCamera2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ In order to build, the following will be required:
4444
PATH.
4545

4646
If everything is setup correctly, running the build.sh script in this directory,
47-
with the current directory set to here, whould build the HelloAndroidCamera2 apk
47+
with the current directory set to here, would build the HelloAndroidCamera2 apk
4848
and install it on a connected Android device.
4949

5050
# Gradle

apps/HelloBaremetal/cmake-external_project/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ add_executable(${GEN_EXE} IMPORTED)
4141
# Specify the location of exe file to import
4242
set_property(TARGET ${GEN_EXE}
4343
PROPERTY IMPORTED_LOCATION ${GEN_BINARY_DIR}/${GEN_EXE})
44-
# Associate with external project so that it invokes build porcess
44+
# Associate with external project so that it invokes build process
4545
add_dependencies(${GEN_EXE} gen_project)
4646

4747
# Generate filter function

apps/HelloBaremetal/cmake/toolchain.noos-arm32-sample.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
1212
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
1313
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
1414

15-
# For newlib (standard C libraray) and semihosting mode
15+
# For newlib (standard C library) and semihosting mode
1616
set(C_COMMON_FLAGS "-specs=rdimon.specs")
1717

1818
# Target CPU dependent flags to use NEON. Please modify for your target.

apps/hannk/compare_vs_tflite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ int main(int argc, char **argv) {
99

1010
ModelRunner runner;
1111

12-
// Default the exernal delegate to disabled, since it may
12+
// Default the external delegate to disabled, since it may
1313
// need extra setup to work (eg LD_LIBRARY_PATH or --external_delegate_path)
1414
runner.do_run[ModelRunner::kExternalDelegate] = false;
1515

apps/hannk/delegate/hannk_delegate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class HannkDelegateKernel final {
271271
HLOG(INFO) << "Delegate " << (void *)this << " Init nodes: " << node_indices << "\n";
272272
}
273273

274-
// Pre-emptively map *all* the TFLiteTensors into our Tensor type.
274+
// Preemptively map *all* the TFLiteTensors into our Tensor type.
275275
for (size_t tensor_id = 0; tensor_id < context->tensors_size; tensor_id++) {
276276
const TfLiteTensor &tensor = context->tensors[tensor_id];
277277
if (tensor.dims == nullptr) {

apps/hannk/interpreter/elementwise_program.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ElementwiseAssembler {
6666
}
6767

6868
// Assemble the current program. The return value is the buffer
69-
// fromt his assembler cropped to the region needed for the program.
69+
// from this assembler cropped to the region needed for the program.
7070
Halide::Runtime::Buffer<int16_t, 2> assemble(std::initializer_list<Slot> outputs);
7171

7272
// Write the current program to the given stream.

apps/hannk/interpreter/lower.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ namespace hannk {
1010
// and remove the 'LstmElementwiseOp' op.
1111
OpPtr lower_tflite_lstm(TensorPtr data_input, TensorPtr prev_activ_input, TensorPtr weights_input, TensorPtr biases_input, TensorPtr prev_state_input,
1212
TensorPtr activ_output, TensorPtr state_output, TensorPtr concat_temp, TensorPtr activ_temp,
13-
ActivationFunction activation) {
13+
ActivationFunction activation_fn) {
1414
std::vector<TensorPtr> inputs = {data_input, prev_activ_input, weights_input, biases_input, prev_state_input};
1515
std::vector<TensorPtr> outputs = {activ_output, state_output};
1616

1717
std::vector<OpPtr> ops;
1818

1919
std::vector<TensorPtr> concat_inputs = {data_input, prev_activ_input};
2020
ops.push_back(make_op<ConcatenationOp>(concat_inputs, concat_temp, 0));
21-
ops.push_back(lower_tflite_fullyconnected(concat_temp, weights_input, biases_input, activ_temp, activation));
21+
ops.push_back(lower_tflite_fullyconnected(concat_temp, weights_input, biases_input, activ_temp, activation_fn));
2222

2323
// Split activ_temp into the 4 ops we need.
2424
Box elementwise_bounds = activ_temp->bounds();
@@ -61,12 +61,12 @@ OpPtr lower_tflite_lstm(TensorPtr data_input, TensorPtr prev_activ_input, Tensor
6161
auto prev_state_times_forget_state = p.mul(forget_gate_output, prev_state);
6262

6363
auto state = p.add(input_times_input_modulation, prev_state_times_forget_state);
64-
auto activ = p.mul_add(output_gate_output, p.tanh(7, state, q - 4), 128);
64+
auto activation = p.mul_add(output_gate_output, p.tanh(7, state, q - 4), 128);
6565
// Reload new_state so it's in the right place for the outputs.
6666
// TODO: Make the assembler smart enough to do this itself.
6767
state = p.add(state, 0);
6868

69-
auto program_buf = p.assemble({activ, state});
69+
auto program_buf = p.assemble({activation, state});
7070
program_buf = program_buf.copy();
7171

7272
ops.push_back(make_op<ElementwiseProgramOp>(elementwise_inputs, elementwise_outputs, program_buf));

0 commit comments

Comments
 (0)