Skip to content

Commit 42eb655

Browse files
committed
update
Signed-off-by: YdrMaster <[email protected]>
1 parent 921d30e commit 42eb655

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

reading/tensor.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,24 @@ struct Tensor {
5353
> BTW,高维数组的维数在张量中称为“阶数”(`order`)。
5454
5555
```plaintext
56+
shape: []
57+
---------
5658
x
5759
```
5860

5961
- 数组,在深度学习程序中称为“向量”,表示为一个阶数为 1 的张量;
6062

6163
```plaintext
64+
shape: [x] = 6
65+
--------------
6266
[1, 2, 3, 4, 5, 6]
6367
```
6468

6569
- 二维数组,在深度学习程序中称为“矩阵”,表示为一个阶数为 2 的张量;
6670

6771
```plaintext
72+
shape: [y x] = 3 x 4
73+
--------------------
6874
\------------/
6975
| 1 2 3 4 |
7076
| 5 6 7 8 |
@@ -108,12 +114,12 @@ shape: [ z y x] = 2 x 3 x 4
108114
strides: [(n) sz sy sx] = (24) 12 4 1
109115
-------------------------------------
110116
/ z
111-
*--x ____________ -> ___________
112-
| / /| -> / /|
113-
y / 13 14 15 16| -> / +12 / |
114-
/----------/20| -> /--/------/ |
117+
*--x ____________ ___________
118+
| / /| / /|
119+
y / 13 14 15 16| / +12 / |
120+
/----------/20| /--/------/ |
115121
|1 2 3 4|24| -> | O → +1 | /
116-
|5 6 7 8| / -> | ↓ | /
117-
|9 10 11 12|/ -> |+4 |/
118-
/----------/ -> /---------/
122+
|5 6 7 8| / | ↓ | /
123+
|9 10 11 12|/ |+4 |/
124+
/----------/ /---------/
119125
```

0 commit comments

Comments
 (0)