@@ -32,19 +32,22 @@ HERE: test/operations/test_block_tensor.ml:59:21
3232 ; [ 7.00 ; 8.00 ; 9.00 ]
3333]
3434
35- --- Test 5: Scalars in block tensor ---
36- HERE: test/operations/test_block_tensor.ml:73:21
37- [48]: ++^_scalar_stack shape 0:3 [ 1.00 ; 2.00 ; 3.00 ]
35+ --- Test 5: Nested block matrix [[a; b]; [c; d]] ---
36+ HERE: test/operations/test_block_tensor.ml:78:21
37+ [60]: ++^_block_matrix shape 0:2,1:2,2:2 [
38+ [ [ 1.00 ; 2.00 ] ; [ 3.00 ; 4.00 ] ]
39+ ; [ [ 5.00 ; 6.00 ] ; [ 7.00 ; 8.00 ] ]
40+ ]
3841
3942--- Test 6: Single element [x1] ---
40- HERE: test/operations/test_block_tensor.ml:80 :21
41- [52 ]: ++^_unsqueezed shape 0:1,1:3 [ [ 1.00 ; 2.00 ; 3.00 ] ]
43+ HERE: test/operations/test_block_tensor.ml:85 :21
44+ [64 ]: ++^_unsqueezed shape 0:1,1:3 [ [ 1.00 ; 2.00 ; 3.00 ] ]
4245
4346--- Test 7: Gradient flow (2-way) ---
4447grad_result (sin of stacked):
45- HERE: test/operations/test_block_tensor.ml:99 :21
48+ HERE: test/operations/test_block_tensor.ml:104 :21
4649┌────────────────────────────────────┐
47- │[64 ]: sin_grad_result shape 0:2,1:2 │
50+ │[76 ]: sin_grad_result shape 0:2,1:2 │
4851│┌──────┬───────────────────┐ │
4952││ │axis 1 │ │
5053│├──────┼───────────────────┤ │
@@ -54,17 +57,17 @@ HERE: test/operations/test_block_tensor.ml:99:21
5457└────────────────────────────────────┘
5558
5659Gradient of g1 (should be cos of original):
57- HERE: test/operations/test_block_tensor.ml:101 :21
60+ HERE: test/operations/test_block_tensor.ml:106 :21
5861┌────────────────────┐
59- │[54 ]: 1,2 shape 0:2 │
62+ │[66 ]: 1,2 shape 0:2 │
6063│┌┬────────────┐ │
6164│││axis 0 │ │
6265│├┼────────────┤ │
6366│││ 1.00 2.00 │ │
6467│└┴────────────┘ │
6568└────────────────────┘
6669┌─────────────────────────────┐
67- │[54 ]: 1,2 shape 0:2 grad_1,2│
70+ │[66 ]: 1,2 shape 0:2 grad_1,2│
6871│┌┬───────────────────┐ │
6972│││axis 0 │ │
7073│├┼───────────────────┤ │
@@ -73,17 +76,17 @@ HERE: test/operations/test_block_tensor.ml:101:21
7376└─────────────────────────────┘
7477
7578Gradient of g2:
76- HERE: test/operations/test_block_tensor.ml:103 :21
79+ HERE: test/operations/test_block_tensor.ml:108 :21
7780┌────────────────────┐
78- │[56 ]: 3,4 shape 0:2 │
81+ │[68 ]: 3,4 shape 0:2 │
7982│┌┬────────────┐ │
8083│││axis 0 │ │
8184│├┼────────────┤ │
8285│││ 3.00 4.00 │ │
8386│└┴────────────┘ │
8487└────────────────────┘
8588┌─────────────────────────────┐
86- │[56 ]: 3,4 shape 0:2 grad_3,4│
89+ │[68 ]: 3,4 shape 0:2 grad_3,4│
8790│┌┬────────────────────┐ │
8891│││axis 0 │ │
8992│├┼────────────────────┤ │
@@ -93,9 +96,9 @@ HERE: test/operations/test_block_tensor.ml:103:21
9396
9497--- Test 8: Gradient flow (3-way) ---
9598grad3_result (sin of 3-way stacked):
96- HERE: test/operations/test_block_tensor.ml:126 :21
99+ HERE: test/operations/test_block_tensor.ml:131 :21
97100┌─────────────────────────────────────┐
98- │[84 ]: sin_grad3_result shape 0:3,1:2 │
101+ │[96 ]: sin_grad3_result shape 0:3,1:2 │
99102│┌──────┬──────────────────┐ │
100103││ │axis 1 │ │
101104│├──────┼──────────────────┤ │
@@ -106,17 +109,17 @@ HERE: test/operations/test_block_tensor.ml:126:21
106109└─────────────────────────────────────┘
107110
108111Gradient of h1:
109- HERE: test/operations/test_block_tensor.ml:128 :21
112+ HERE: test/operations/test_block_tensor.ml:133 :21
110113┌────────────────────────┐
111- │[70 ]: 0.5,1.5 shape 0:2 │
114+ │[82 ]: 0.5,1.5 shape 0:2 │
112115│┌┬───────────────┐ │
113116│││axis 0 │ │
114117│├┼───────────────┤ │
115118│││ 5.00e-1 1.50 │ │
116119│└┴───────────────┘ │
117120└────────────────────────┘
118121┌─────────────────────────────────────┐
119- │[70 ]: 0.5,1.5 shape 0:2 grad_0.5,1.5│
122+ │[82 ]: 0.5,1.5 shape 0:2 grad_0.5,1.5│
120123│┌┬──────────────────┐ │
121124│││axis 0 │ │
122125│├┼──────────────────┤ │
@@ -125,17 +128,17 @@ HERE: test/operations/test_block_tensor.ml:128:21
125128└─────────────────────────────────────┘
126129
127130Gradient of h2:
128- HERE: test/operations/test_block_tensor.ml:130 :21
131+ HERE: test/operations/test_block_tensor.ml:135 :21
129132┌────────────────────┐
130- │[72 ]: 1,2 shape 0:2 │
133+ │[84 ]: 1,2 shape 0:2 │
131134│┌┬────────────┐ │
132135│││axis 0 │ │
133136│├┼────────────┤ │
134137│││ 1.00 2.00 │ │
135138│└┴────────────┘ │
136139└────────────────────┘
137140┌─────────────────────────────┐
138- │[72 ]: 1,2 shape 0:2 grad_1,2│
141+ │[84 ]: 1,2 shape 0:2 grad_1,2│
139142│┌┬───────────────────┐ │
140143│││axis 0 │ │
141144│├┼───────────────────┤ │
@@ -144,17 +147,17 @@ HERE: test/operations/test_block_tensor.ml:130:21
144147└─────────────────────────────┘
145148
146149Gradient of h3:
147- HERE: test/operations/test_block_tensor.ml:132 :21
150+ HERE: test/operations/test_block_tensor.ml:137 :21
148151┌──────────────────────┐
149- │[74 ]: 3,0.1 shape 0:2 │
152+ │[86 ]: 3,0.1 shape 0:2 │
150153│┌┬───────────────┐ │
151154│││axis 0 │ │
152155│├┼───────────────┤ │
153156│││ 3.00 1.00e-1 │ │
154157│└┴───────────────┘ │
155158└──────────────────────┘
156159┌─────────────────────────────────┐
157- │[74 ]: 3,0.1 shape 0:2 grad_3,0.1│
160+ │[86 ]: 3,0.1 shape 0:2 grad_3,0.1│
158161│┌┬───────────────────┐ │
159162│││axis 0 │ │
160163│├┼───────────────────┤ │
0 commit comments