Skip to content

Commit 0098e77

Browse files
committed
readthedocs configuration
1 parent 6ce87d8 commit 0098e77

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.readthedocs.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-lts-latest
5+
tools:
6+
rust: latest
7+
jobs:
8+
install:
9+
- cargo install mdbook mdbook-katex mdbook-toc mdbook-admonish
10+
build:
11+
html:
12+
- mdbook build docs --dest-dir $READTHEDOCS_OUTPUT/html

docs/src/ri_rccsdt.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,10 @@ get_w([c, b, a], w.view_mut(), wbuf.view_mut(), intermediates, &tr_indices.tr_21
404404
C. 涉及到的 elementwise 运算中,计算 $V_{ijk}^{[abc]}$ 时使用到了 broadcast 数乘;但目前 RSTSR 的 broadcast elementwise 运算的实现效率仅仅满足一般需求,其性能没有达到极限。如果确实是 broadcast elementwise 导致性能低下,建议手动展开 for 循环。
405405

406406
D. 用于计算 $V_{ijk}^{[abc]}$ 的 broadcast elementwise 运算,若手动展开 for 循环,则需要对张量进行索引。为更高效地进行张量索引,一般需要做三件事:
407-
- 在确保索引不会越界的情况下,使用 `index_uncheck` 以避免越界检查 (这是决定性因素);
408-
- 低维度的索引代价总是小于高维度;尽可能先取出子张量,对更低维度的子张量进行索引;
409-
- 若在索引前能确保张量维度的大小,则尽量通过 `into_dim` 转换到静态维度。
407+
408+
- 在确保索引不会越界的情况下,使用 `index_uncheck` 以避免越界检查 (这是决定性因素);
409+
- 低维度的索引代价总是小于高维度;尽可能先取出子张量,对更低维度的子张量进行索引;
410+
- 若在索引前能确保张量维度的大小,则尽量通过 `into_dim` 转换到静态维度。
410411

411412
E. 如果是多步计算,譬如计算 $Z_{ijk}^{[abc]}$ 时涉及到多个张量的求和,对于这种情形最好使用迭代器以避免多次写入:对于特定的指标 $(i, j, k)$ 多次读入张量并求和、但只写入一次到 $Z_{ijk}^{[abc]}$[^2]
412413

0 commit comments

Comments
 (0)