Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 1df0e77

Browse files
committed
Config changes and README for doxygen docs
1 parent 0b8c0d1 commit 1df0e77

File tree

5 files changed

+55
-21
lines changed

5 files changed

+55
-21
lines changed

docs/README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Writing documentation for Tensor Comprehensions
1+
# Generating Sphinx documentation for Tensor Comprehensions
22

33
1. First install sphinx
44

@@ -24,3 +24,34 @@ cd docs && make html
2424
5. Now you can see the generated html `index.html` under `build/html/`
2525

2626
6. Send PR
27+
28+
# Generating Doxygen docs for Tensor Comprehensions
29+
30+
1. Install Doxygen
31+
32+
Run the command
33+
34+
```Shell
35+
$ apt-get install doxygen
36+
```
37+
38+
2. Edit the `docs/doxygen/index.md` file for making changes to the main page for
39+
doxygen docs.
40+
41+
3. Edit the `docs/doxygen/Doxyfile` file for making change to what code should be
42+
documented, excluded etc.
43+
44+
4. Now, test the docs locally. Run the following commands:
45+
46+
```Shell
47+
$ cd $HOME/TensorComprehensions && mkdir -p $HOME/TensorComprehensions-docs/api
48+
$ doxygen docs/doxygen/Doxyfile
49+
```
50+
51+
This will generate an `html` folder which will contain all the html files for the
52+
documentation. Please `DO NOT` edit the `html` folder manually. Rather make changes
53+
as suggested in Step 2, 3 and re-generate docs.
54+
55+
5. Check the HTML docs look fine to you.
56+
57+
6. Send a PR

docs/doxygen/Doxyfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ PROJECT_BRIEF =
5151
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
5252
# the logo to the output directory.
5353

54-
PROJECT_LOGO = docs/doxygen/tc-logo-small.png
54+
PROJECT_LOGO = docs/doxygen/img/tc-logo-small.png
5555

5656
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
5757
# into which the generated documentation will be written. If a relative path is
@@ -811,7 +811,7 @@ RECURSIVE = YES
811811
# Note that relative paths are relative to the directory from which doxygen is
812812
# run.
813813

814-
EXCLUDE =
814+
EXCLUDE =
815815

816816
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
817817
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -1068,7 +1068,7 @@ GENERATE_HTML = YES
10681068
# The default directory is: html.
10691069
# This tag requires that the tag GENERATE_HTML is set to YES.
10701070

1071-
HTML_OUTPUT = html
1071+
HTML_OUTPUT = ../TensorComprehensions-docs/html/api/
10721072

10731073
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
10741074
# generated HTML page (for example: .htm, .php, .asp).
@@ -1416,7 +1416,7 @@ DISABLE_INDEX = NO
14161416
# The default value is: NO.
14171417
# This tag requires that the tag GENERATE_HTML is set to YES.
14181418

1419-
GENERATE_TREEVIEW = NO
1419+
GENERATE_TREEVIEW = YES
14201420

14211421
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
14221422
# doxygen will group on one line in the generated HTML documentation.
File renamed without changes.

docs/doxygen/index.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ Tensor Comprehension Notation
1515
-----------------------------
1616
TC borrow three ideas from Einstein notation that make expressions concise:
1717

18-
1. loop index variables are defined implicitly by using them in an expression and their range is aggressively inferred based on what they index,
19-
2. indices that appear on the right of an expression but not on the left are assumed to be reduction dimensions,
20-
3. the evaluation order of points in the iteration space does not affect the output.
18+
1. Loop index variables are defined implicitly by using them in an expression and their range is aggressively inferred based on what they index.
19+
2. Indices that appear on the right of an expression but not on the left are assumed to be reduction dimensions.
20+
3. The evaluation order of points in the iteration space does not affect the output.
2121

2222
Let's start with a simple example is a matrix vector product:
2323

24-
def mv(float(R,C) A, float(C) x) -> (o) {
25-
o(i) +=! A(i,j) * b(j)
24+
def mv(float(R,C) A, float(C) B) -> (o) {
25+
o(i) +=! A(i,j) * B(j)
2626
}
2727

2828
`A` and `x` are input tensors. `o` is an output tensor.
29-
The statement `o(i) += A(i,j)*b(j)` introduces two index variables `i` and `j`.
30-
Their range is inferred by their use indexing `A` and `b`. `i = [0,R)`, `j = [0,C)`.
29+
The statement `o(i) += A(i,j) * b(j)` introduces two index variables `i` and `j`.
30+
Their range is inferred by their use indexing `A` and `B`. `i = [0,R)`, `j = [0,C)`.
3131
Because `j` only appears on the right side,
3232
stores into `o` will reduce over `j` with the reduction specified for the loop.
3333
Reductions can occur across multiple variables, but they all share the same kind of associative reduction (e.g. +=)
@@ -36,7 +36,7 @@ to maintain invariant (3). `mv` computes the same thing as this C++ loop:
3636
for(int i = 0; i < R; i++) {
3737
o(i) = 0.0f;
3838
for(int j = 0; j < C; j++) {
39-
o(i) += A(i,j) * b(j);
39+
o(i) += A(i,j) * B(j);
4040
}
4141
}
4242

@@ -47,30 +47,33 @@ Examples of TC
4747

4848
We provide a few basic examples.
4949

50-
Simple matrix-vector:
50+
**Simple matrix-vector**:
5151

52-
def mv(float(R,C) A, float(C) x) -> (o) {
53-
o(i) += A(i,j) * b(j)
52+
def mv(float(R,C) A, float(C) B) -> (o) {
53+
o(i) += A(i,j) * B(j)
5454
}
5555

56-
Simple matrix-multiply (note the layout for B is transposed and matches the
56+
**Simple matrix-multiply:**
57+
58+
Note the layout for B is transposed and matches the
5759
traditional layout of the weight matrix in a linear layer):
5860

5961
def mm(float(X,Y) A, float(Y,Z) B) -> (R) {
6062
R(i,j) += A(i,j) * B(j,k)
6163
}
6264

63-
Simple 2-D convolution (no stride, no padding):
65+
**Simple 2-D convolution (no stride, no padding):**
6466

6567
def conv(float(B,IP,H,W) input, float(OP,IP,KH,KW) weight) -> (output) {
6668
output(b, op, h, w) += input(b, ip, h + kh, w + kw) * weight(op, ip, kh, kw)
6769
}
6870

69-
Simple 2D max pooling (note the similarity with a convolution with a
71+
**Simple 2D max pooling:**
72+
73+
Note the similarity with a convolution with a
7074
"select"-style kernel):
7175

7276
def maxpool2x2(float(B,C,H,W) input) -> (output) {
7377
output(b,c,i,j) max= input(b,c,2*i + kw, 2*j + kh)
7478
where kw = [0, 2[, kh = [0, 2[
7579
}
76-

docs/source/installation_caffe2_integration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Set environment variables:
105105
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/targets/x86_64-linux/lib/stubs/:$LD_LIBRARY_PATH
106106
$ export PATH=/usr/local/bin:/usr/local/cuda/bin:$PATH
107107
108-
.. _conda_dep_install_tc:
108+
.. _conda_dep_install_tc_caffe2:
109109

110110
Step 5: Install TC with Caffe2
111111
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)