《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。
This report summarizes scanner evidence for d2l-ai/d2l-zh, a Python project with 82,781 GitHub stars. SynthScan examined 115,143 lines of code across 331 source files, recording 342 pattern matches distributed across 8 syntactic categories. The legacy adjusted pattern signal is 13.2 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-11-27.
Can maintainers explain intent, assumptions, and trade-offs? 40 finding(s).
Are imports declared and package/API names verified? 9 finding(s).
Are wrappers, guards, and repeated structures necessary? 314 finding(s).
Which changes need focused human review? 342 finding(s).
Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 342 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | d2l/mxnet.py | 0 | 使用svg格式在jupyter中显示绘图 defined in :numref:`sec_calculus` | STRING |
| HIGH | d2l/paddle.py | 0 | 使用svg格式在jupyter中显示绘图 defined in :numref:`sec_calculus` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 使用svg格式在jupyter中显示绘图 defined in :numref:`sec_calculus` | STRING |
| HIGH | d2l/torch.py | 0 | 使用svg格式在jupyter中显示绘图 defined in :numref:`sec_calculus` | STRING |
| HIGH | d2l/mxnet.py | 0 | 设置matplotlib的图表大小 defined in :numref:`sec_calculus` | STRING |
| HIGH | d2l/paddle.py | 0 | 设置matplotlib的图表大小 defined in :numref:`sec_calculus` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 设置matplotlib的图表大小 defined in :numref:`sec_calculus` | STRING |
| HIGH | d2l/torch.py | 0 | 设置matplotlib的图表大小 defined in :numref:`sec_calculus` | STRING |
| HIGH | d2l/mxnet.py | 0 | 生成y=xw+b+噪声 defined in :numref:`sec_linear_scratch` | STRING |
| HIGH | d2l/paddle.py | 0 | 生成y=xw+b+噪声 defined in :numref:`sec_linear_scratch` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 生成y=xw+b+噪声 defined in :numref:`sec_linear_scratch` | STRING |
| HIGH | d2l/torch.py | 0 | 生成y=xw+b+噪声 defined in :numref:`sec_linear_scratch` | STRING |
| HIGH | d2l/mxnet.py | 0 | 返回fashion-mnist数据集的文本标签 defined in :numref:`sec_fashion_mnist` | STRING |
| HIGH | d2l/paddle.py | 0 | 返回fashion-mnist数据集的文本标签 defined in :numref:`sec_fashion_mnist` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 返回fashion-mnist数据集的文本标签 defined in :numref:`sec_fashion_mnist` | STRING |
| HIGH | d2l/torch.py | 0 | 返回fashion-mnist数据集的文本标签 defined in :numref:`sec_fashion_mnist` | STRING |
| HIGH | d2l/mxnet.py | 0 | 下载fashion-mnist数据集,然后将其加载到内存中 defined in :numref:`sec_fashion_mnist` | STRING |
| HIGH | d2l/paddle.py | 0 | 下载fashion-mnist数据集,然后将其加载到内存中 defined in :numref:`sec_fashion_mnist` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 下载fashion-mnist数据集,然后将其加载到内存中 defined in :numref:`sec_fashion_mnist` | STRING |
| HIGH | d2l/torch.py | 0 | 下载fashion-mnist数据集,然后将其加载到内存中 defined in :numref:`sec_fashion_mnist` | STRING |
| HIGH | d2l/mxnet.py | 0 | 计算在指定数据集上模型的精度 defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/paddle.py | 0 | 计算在指定数据集上模型的精度 defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 计算在指定数据集上模型的精度 defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/torch.py | 0 | 计算在指定数据集上模型的精度 defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/mxnet.py | 0 | 训练模型一个迭代周期(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/paddle.py | 0 | 训练模型一个迭代周期(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 训练模型一个迭代周期(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/torch.py | 0 | 训练模型一个迭代周期(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/mxnet.py | 0 | 训练模型(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/paddle.py | 0 | 训练模型(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 训练模型(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/torch.py | 0 | 训练模型(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/mxnet.py | 0 | 预测标签(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/paddle.py | 0 | 预测标签(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 预测标签(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/torch.py | 0 | 预测标签(定义见第3章) defined in :numref:`sec_softmax_scratch` | STRING |
| HIGH | d2l/mxnet.py | 0 | 评估给定数据集上模型的损失 defined in :numref:`sec_model_selection` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 评估给定数据集上模型的损失 defined in :numref:`sec_model_selection` | STRING |
| HIGH | d2l/torch.py | 0 | 评估给定数据集上模型的损失 defined in :numref:`sec_model_selection` | STRING |
| HIGH | d2l/mxnet.py | 0 | 下载一个data_hub中的文件,返回本地文件名 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/paddle.py | 0 | 下载一个data_hub中的文件,返回本地文件名 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 下载一个data_hub中的文件,返回本地文件名 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/torch.py | 0 | 下载一个data_hub中的文件,返回本地文件名 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/mxnet.py | 0 | 下载并解压zip/tar文件 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/paddle.py | 0 | 下载并解压zip/tar文件 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 下载并解压zip/tar文件 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/torch.py | 0 | 下载并解压zip/tar文件 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/mxnet.py | 0 | 下载data_hub中的所有文件 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/paddle.py | 0 | 下载data_hub中的所有文件 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 下载data_hub中的所有文件 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/torch.py | 0 | 下载data_hub中的所有文件 defined in :numref:`sec_kaggle_house` | STRING |
| HIGH | d2l/mxnet.py | 0 | 如果存在,则返回gpu(i),否则返回cpu() defined in :numref:`sec_use_gpu` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 如果存在,则返回gpu(i),否则返回cpu() defined in :numref:`sec_use_gpu` | STRING |
| HIGH | d2l/torch.py | 0 | 如果存在,则返回gpu(i),否则返回cpu() defined in :numref:`sec_use_gpu` | STRING |
| HIGH | d2l/mxnet.py | 0 | 将时间机器数据集加载到文本行的列表中 defined in :numref:`sec_text_preprocessing` | STRING |
| HIGH | d2l/paddle.py | 0 | 将时间机器数据集加载到文本行的列表中 defined in :numref:`sec_text_preprocessing` | STRING |
| HIGH | d2l/tensorflow.py | 0 | 将时间机器数据集加载到文本行的列表中 defined in :numref:`sec_text_preprocessing` | STRING |
| HIGH | d2l/torch.py | 0 | 将时间机器数据集加载到文本行的列表中 defined in :numref:`sec_text_preprocessing` | STRING |
| HIGH | d2l/mxnet.py | 0 | 将文本行拆分为单词或字符词元 defined in :numref:`sec_text_preprocessing` | STRING |
| HIGH | d2l/paddle.py | 0 | 将文本行拆分为单词或字符词元 defined in :numref:`sec_text_preprocessing` | STRING |
| 232 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | d2l/mxnet.py | 2217 | def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len): | CODE |
| LOW | d2l/mxnet.py | 2257 | def _get_mlm_data_from_tokens(tokens, vocab): | CODE |
| LOW | d2l/paddle.py | 2356 | def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len): | CODE |
| LOW | d2l/paddle.py | 2396 | def _get_mlm_data_from_tokens(tokens, vocab): | CODE |
| LOW | d2l/torch.py | 2346 | def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len): | CODE |
| LOW | d2l/torch.py | 2386 | def _get_mlm_data_from_tokens(tokens, vocab): | CODE |
| LOW | contrib/to-rm-mx-contrib-text/d2lzh/utils.py | 617 | def train_and_predict_rnn_gluon(model, num_hiddens, vocab_size, ctx, | CODE |
| LOW | contrib/to-rm-mx-contrib-text/d2lzh/text/embedding.py | 48 | def get_pretrained_file_names(embedding_name=None): | CODE |
| LOW | …language-processing-pretraining/bert-dataset_origin.md | 102 | def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len): | CODE |
| LOW | …language-processing-pretraining/bert-dataset_origin.md | 174 | def _get_mlm_data_from_tokens(tokens, vocab): | CODE |
| LOW | …atural-language-processing-pretraining/bert-dataset.md | 82 | def _get_nsp_data_from_paragraph(paragraph, paragraphs, vocab, max_len): | CODE |
| LOW | …atural-language-processing-pretraining/bert-dataset.md | 135 | def _get_mlm_data_from_tokens(tokens, vocab): | CODE |
| LOW | static/post_latex/main.py | 81 | def _delete_discussions_title(lines): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | d2l/mxnet.py | 343 | CODE | |
| LOW | d2l/paddle.py | 381 | CODE | |
| LOW | d2l/paddle.py | 752 | CODE | |
| LOW | d2l/tensorflow.py | 359 | CODE | |
| LOW | d2l/torch.py | 370 | CODE | |
| LOW | d2l/torch.py | 739 | CODE | |
| LOW | ci/submit-job.py | 126 | CODE | |
| LOW | contrib/to-rm-mx-contrib-text/d2lzh/utils.py | 572 | CODE | |
| LOW | static/post_latex/main.py | 6 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | d2l/paddle.py | 35 | CODE | |
| LOW | d2l/tensorflow.py | 20 | CODE | |
| LOW | d2l/tensorflow.py | 26 | CODE | |
| LOW | d2l/torch.py | 7 | CODE | |
| LOW | d2l/torch.py | 43 | CODE | |
| LOW | contrib/to-rm-mx-contrib-text/d2lzh/__init__.py | 1 | CODE | |
| LOW | contrib/to-rm-mx-contrib-text/d2lzh/__init__.py | 2 | CODE | |
| LOW | contrib/to-rm-mx-contrib-text/d2lzh/text/__init__.py | 1 | CODE | |
| LOW | contrib/to-rm-mx-contrib-text/d2lzh/text/__init__.py | 2 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | d2l/mxnet.py | 69 | CODE | |
| LOW | d2l/mxnet.py | 264 | CODE | |
| LOW | d2l/paddle.py | 66 | CODE | |
| LOW | d2l/paddle.py | 300 | CODE | |
| LOW | d2l/tensorflow.py | 64 | CODE | |
| LOW | d2l/tensorflow.py | 269 | CODE | |
| LOW | d2l/torch.py | 76 | CODE | |
| LOW | d2l/torch.py | 289 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | d2l/paddle.py | 1221 | # (batch_size,查询或者“键-值”对的个数,num_hiddens) | COMMENT |
| LOW | chapter_convolutional-modern/alexnet_origin.md | 321 | COMMENT | |
| LOW | chapter_convolutional-modern/alexnet_origin.md | 361 | return tf.keras.models.Sequential([ | COMMENT |
| LOW | …deep-learning-computation/model-construction_origin.md | 261 | # required model output based on the input `X` | COMMENT |
| LOW | …ter_attention-mechanisms/multihead-attention_origin.md | 201 | of the `transpose_qkv` function. | COMMENT |
| LOW | chapter_attention-mechanisms/nadaraya-waston.md | 241 | ```{.python .input} | COMMENT |
| LOW | …ocessing-applications/sentiment-analysis-rnn_origin.md | 81 | super(BiRNN, self).__init__(**kwargs) | COMMENT |
| LOW | …ocessing-applications/sentiment-analysis-rnn_origin.md | 121 | # LSTM requires its input's first dimension to be the temporal | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | contrib/to-rm-mx-contrib-text/d2lzh/utils.py | 773 | except mx.base.MXNetError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | static/post_latex/main.py | 34 | # Set tocdepth to 2 after Chap 1 | COMMENT |
| LOW | .github/workflow_scripts/build_and_deploy.sh | 29 | # Check if the JOB_NAME is "$REPO_NAME/release" | COMMENT |