|
25 | 25 |
|
26 | 26 | .. class:: TensorEssence : serializable |
27 | 27 |
|
28 | | - .. attribute:: type eltType = real |
| 28 | + .. type:: config type eltType = real |
29 | 29 |
|
30 | 30 | .. method:: proc runtimeRank: int |
31 | 31 |
|
|
35 | 35 |
|
36 | 36 | .. class:: ForgetfulTensor : TensorEssence |
37 | 37 |
|
38 | | - .. attribute:: param rank: int |
| 38 | + .. data:: config param rank: int |
39 | 39 |
|
40 | 40 | .. class:: BaseTensorResource : TensorEssence, serializable |
41 | 41 |
|
42 | | - .. attribute:: param rank: int |
| 42 | + .. data:: config param rank: int |
43 | 43 |
|
44 | | - .. attribute:: var dataResource: shared Remote(ndarray(rank, eltType)) |
| 44 | + .. data:: config var dataResource: shared Remote(ndarray(rank, eltType)) |
45 | 45 |
|
46 | | - .. attribute:: var gradResource: shared Remote(ndarray(rank, eltType))? |
| 46 | + .. data:: config var gradResource: shared ?Remote(ndarray(rank, eltType)) |
47 | 47 |
|
48 | 48 | .. method:: proc init(type eltType, param rank: int) |
49 | 49 |
|
50 | | - .. method:: proc init(in dataResource: shared Remote(ndarray(?rank, ?eltType)), in gradResource: shared Remote(ndarray(rank, eltType))? = nil) |
| 50 | + .. method:: proc init(in dataResource: shared Remote(ndarray(?rank, ?eltType)), in gradResource: shared ?Remote(ndarray(rank, eltType)) = nil) |
51 | 51 |
|
52 | 52 | .. method:: proc init(data: ndarray(?rank, ?eltType), device: locale = Remote.defaultDevice) |
53 | 53 |
|
|
65 | 65 |
|
66 | 66 | .. method:: proc backward() where rank == 1 |
67 | 67 |
|
68 | | - .. method:: proc detach(copy: bool = true, keepGrad: bool = false): owned TensorResource(eltType, rank, baseValue) |
| 68 | + .. method:: proc detach(copy: bool = true, keepGrad: bool = false): owned(TensorResource(eltType, rank, baseValue)) |
69 | 69 |
|
70 | 70 | .. method:: override proc runtimeRank: int |
71 | 71 |
|
72 | 72 | .. class:: TensorResource : BaseTensorResource(?), serializable |
73 | 73 |
|
74 | | - .. attribute:: type operationType |
| 74 | + .. type:: config type operationType |
75 | 75 |
|
76 | | - .. attribute:: var operationCtx: operationType |
| 76 | + .. data:: config var operationCtx: operationType |
77 | 77 |
|
78 | 78 | .. method:: proc init(type eltType, param rank: int, operationCtx: ?operationType) |
79 | 79 |
|
80 | | - .. method:: proc init(in dataResource: shared Remote(ndarray(?rank, ?eltType)), in gradResource: shared Remote(ndarray(rank, eltType))? = nil, operationCtx: ?operationType) |
| 80 | + .. method:: proc init(in dataResource: shared Remote(ndarray(?rank, ?eltType)), in gradResource: shared ?Remote(ndarray(rank, eltType)) = nil, operationCtx: ?operationType) |
81 | 81 |
|
82 | 82 | .. method:: proc init(in dataResource: shared Remote(ndarray(?rank, ?eltType))) |
83 | 83 |
|
84 | 84 | .. method:: proc init(bt: borrowed BaseTensorResource(?eltType, ?rank), operationCtx: ?operationType) |
85 | 85 |
|
86 | | - .. method:: override proc detach(copy: bool = true, keepGrad: bool = false): owned TensorResource(eltType, rank, baseValue) |
| 86 | + .. method:: override proc detach(copy: bool = true, keepGrad: bool = false): owned(TensorResource(eltType, rank, baseValue)) |
87 | 87 |
|
88 | 88 | .. method:: override proc forward() |
89 | 89 |
|
|
97 | 97 |
|
98 | 98 | .. record:: reluOp : serializable |
99 | 99 |
|
100 | | - .. attribute:: var input: shared BaseTensorResource(?) |
| 100 | + .. data:: config var input: shared BaseTensorResource(?) |
101 | 101 |
|
102 | 102 | .. method:: proc children |
103 | 103 |
|
|
107 | 107 |
|
108 | 108 | .. record:: expOp : serializable |
109 | 109 |
|
110 | | - .. attribute:: var input: shared BaseTensorResource(?) |
| 110 | + .. data:: config var input: shared BaseTensorResource(?) |
111 | 111 |
|
112 | 112 | .. method:: proc children |
113 | 113 |
|
114 | 114 | .. method:: proc forward() |
115 | 115 |
|
116 | 116 | .. record:: addOp : serializable |
117 | 117 |
|
118 | | - .. attribute:: param rank: int |
| 118 | + .. data:: config param rank: int |
119 | 119 |
|
120 | | - .. attribute:: type eltType |
| 120 | + .. type:: config type eltType |
121 | 121 |
|
122 | | - .. attribute:: var lhs: shared BaseTensorResource(eltType, rank) |
| 122 | + .. data:: config var lhs: shared BaseTensorResource(eltType, rank) |
123 | 123 |
|
124 | | - .. attribute:: var rhs: shared BaseTensorResource(eltType, rank) |
| 124 | + .. data:: config var rhs: shared BaseTensorResource(eltType, rank) |
125 | 125 |
|
126 | 126 | .. method:: proc children |
127 | 127 |
|
|
131 | 131 |
|
132 | 132 | .. record:: subOp : serializable |
133 | 133 |
|
134 | | - .. attribute:: var lhs: shared BaseTensorResource(?) |
| 134 | + .. data:: config var lhs: shared BaseTensorResource(?) |
135 | 135 |
|
136 | | - .. attribute:: var rhs: shared BaseTensorResource(?) |
| 136 | + .. data:: config var rhs: shared BaseTensorResource(?) |
137 | 137 |
|
138 | 138 | .. method:: proc children |
139 | 139 |
|
140 | 140 | .. method:: proc forward() |
141 | 141 |
|
142 | 142 | .. record:: divOp : serializable |
143 | 143 |
|
144 | | - .. attribute:: var lhs: shared BaseTensorResource(?) |
| 144 | + .. data:: config var lhs: shared BaseTensorResource(?) |
145 | 145 |
|
146 | | - .. attribute:: var rhs: shared BaseTensorResource(?) |
| 146 | + .. data:: config var rhs: shared BaseTensorResource(?) |
147 | 147 |
|
148 | 148 | .. method:: proc children |
149 | 149 |
|
150 | 150 | .. method:: proc forward() |
151 | 151 |
|
152 | 152 | .. record:: multOp : serializable |
153 | 153 |
|
154 | | - .. attribute:: param rank: int |
| 154 | + .. data:: config param rank: int |
155 | 155 |
|
156 | | - .. attribute:: type eltType |
| 156 | + .. type:: config type eltType |
157 | 157 |
|
158 | | - .. attribute:: var lhs: shared BaseTensorResource(eltType, rank) |
| 158 | + .. data:: config var lhs: shared BaseTensorResource(eltType, rank) |
159 | 159 |
|
160 | | - .. attribute:: var rhs: shared BaseTensorResource(eltType, rank) |
| 160 | + .. data:: config var rhs: shared BaseTensorResource(eltType, rank) |
161 | 161 |
|
162 | 162 | .. method:: proc children |
163 | 163 |
|
|
167 | 167 |
|
168 | 168 | .. record:: reshapeOp : serializable |
169 | 169 |
|
170 | | - .. attribute:: param oldRank: int |
| 170 | + .. data:: config param oldRank: int |
171 | 171 |
|
172 | | - .. attribute:: param newRank: int |
| 172 | + .. data:: config param newRank: int |
173 | 173 |
|
174 | | - .. attribute:: type eltType |
| 174 | + .. type:: config type eltType |
175 | 175 |
|
176 | | - .. attribute:: var shape: newRank*int |
| 176 | + .. data:: config var shape: newRank*int |
177 | 177 |
|
178 | | - .. attribute:: var input: shared BaseTensorResource(eltType, oldRank) |
| 178 | + .. data:: config var input: shared BaseTensorResource(eltType, oldRank) |
179 | 179 |
|
180 | 180 | .. method:: proc children |
181 | 181 |
|
|
185 | 185 |
|
186 | 186 | .. record:: permuteOp : serializable |
187 | 187 |
|
188 | | - .. attribute:: param rank: int |
| 188 | + .. data:: config param rank: int |
189 | 189 |
|
190 | | - .. attribute:: type eltType = real |
| 190 | + .. type:: config type eltType = real |
191 | 191 |
|
192 | | - .. attribute:: var permutation |
| 192 | + .. data:: config var permutation |
193 | 193 |
|
194 | | - .. attribute:: var input: shared BaseTensorResource(eltType, rank) |
| 194 | + .. data:: config var input: shared BaseTensorResource(eltType, rank) |
195 | 195 |
|
196 | 196 | .. method:: proc children |
197 | 197 |
|
|
201 | 201 |
|
202 | 202 | .. record:: expandOp : serializable |
203 | 203 |
|
204 | | - .. attribute:: param rank: int |
| 204 | + .. data:: config param rank: int |
205 | 205 |
|
206 | | - .. attribute:: type eltType = real |
| 206 | + .. type:: config type eltType = real |
207 | 207 |
|
208 | | - .. attribute:: var expandedShape: rank*int |
| 208 | + .. data:: config var expandedShape: rank*int |
209 | 209 |
|
210 | | - .. attribute:: var input: shared BaseTensorResource(eltType, rank) |
| 210 | + .. data:: config var input: shared BaseTensorResource(eltType, rank) |
211 | 211 |
|
212 | 212 | .. method:: proc children |
213 | 213 |
|
|
217 | 217 |
|
218 | 218 | .. record:: padOp : serializable |
219 | 219 |
|
220 | | - .. attribute:: param rank: int |
| 220 | + .. data:: config param rank: int |
221 | 221 |
|
222 | | - .. attribute:: type eltType = real |
| 222 | + .. type:: config type eltType = real |
223 | 223 |
|
224 | | - .. attribute:: var arg: rank*(2*(int)) |
| 224 | + .. data:: config var arg: rank*2*int |
225 | 225 |
|
226 | | - .. attribute:: var value: eltType |
| 226 | + .. data:: config var value: eltType |
227 | 227 |
|
228 | | - .. attribute:: var input: shared BaseTensorResource(eltType, rank) |
| 228 | + .. data:: config var input: shared BaseTensorResource(eltType, rank) |
229 | 229 |
|
230 | 230 | .. method:: proc children |
231 | 231 |
|
|
235 | 235 |
|
236 | 236 | .. record:: shrinkOp : serializable |
237 | 237 |
|
238 | | - .. attribute:: param rank: int |
| 238 | + .. data:: config param rank: int |
239 | 239 |
|
240 | | - .. attribute:: type eltType = real |
| 240 | + .. type:: config type eltType = real |
241 | 241 |
|
242 | | - .. attribute:: var arg: rank*(2*(int)) |
| 242 | + .. data:: config var arg: rank*2*int |
243 | 243 |
|
244 | | - .. attribute:: var input: shared BaseTensorResource(eltType, rank) |
| 244 | + .. data:: config var input: shared BaseTensorResource(eltType, rank) |
245 | 245 |
|
246 | 246 | .. method:: proc children |
247 | 247 |
|
|
251 | 251 |
|
252 | 252 | .. record:: sliceOp : serializable |
253 | 253 |
|
254 | | - .. attribute:: param rank: int |
| 254 | + .. data:: config param rank: int |
255 | 255 |
|
256 | | - .. attribute:: type eltType = real |
| 256 | + .. type:: config type eltType = real |
257 | 257 |
|
258 | | - .. attribute:: var dom: domain(rank, int) |
| 258 | + .. data:: config var dom: domain(rank, int) |
259 | 259 |
|
260 | | - .. attribute:: var input: shared BaseTensorResource(eltType, rank) |
| 260 | + .. data:: config var input: shared BaseTensorResource(eltType, rank) |
261 | 261 |
|
262 | 262 | .. method:: proc children |
263 | 263 |
|
|
267 | 267 |
|
268 | 268 | .. record:: layerSliceOp : serializable |
269 | 269 |
|
270 | | - .. attribute:: param rank: int |
| 270 | + .. data:: config param rank: int |
271 | 271 |
|
272 | | - .. attribute:: type eltType = real |
| 272 | + .. type:: config type eltType = real |
273 | 273 |
|
274 | | - .. attribute:: var base: shared BaseTensorResource(eltType, rank) |
| 274 | + .. data:: config var base: shared BaseTensorResource(eltType, rank) |
275 | 275 |
|
276 | | - .. attribute:: var mask: shared BaseTensorResource(eltType, rank) |
| 276 | + .. data:: config var mask: shared BaseTensorResource(eltType, rank) |
277 | 277 |
|
278 | | - .. attribute:: var maskDomain: domain(rank, int) |
| 278 | + .. data:: config var maskDomain: domain(rank, int) |
279 | 279 |
|
280 | 280 | .. method:: proc children |
281 | 281 |
|
|
285 | 285 |
|
286 | 286 | .. record:: sumOp : serializable |
287 | 287 |
|
288 | | - .. attribute:: param rank: int |
| 288 | + .. data:: config param rank: int |
289 | 289 |
|
290 | | - .. attribute:: type eltType = real |
| 290 | + .. type:: config type eltType = real |
291 | 291 |
|
292 | | - .. attribute:: param sumRank: int |
| 292 | + .. data:: config param sumRank: int |
293 | 293 |
|
294 | | - .. attribute:: var axes: sumRank*int |
| 294 | + .. data:: config var axes: sumRank*int |
295 | 295 |
|
296 | | - .. attribute:: var input: shared BaseTensorResource(eltType, rank) |
| 296 | + .. data:: config var input: shared BaseTensorResource(eltType, rank) |
297 | 297 |
|
298 | 298 | .. method:: proc children |
299 | 299 |
|
|
305 | 305 |
|
306 | 306 | .. record:: maxOp : serializable |
307 | 307 |
|
308 | | - .. attribute:: param rank: int |
| 308 | + .. data:: config param rank: int |
309 | 309 |
|
310 | | - .. attribute:: type eltType = real |
| 310 | + .. type:: config type eltType = real |
311 | 311 |
|
312 | | - .. attribute:: param maxRank: int |
| 312 | + .. data:: config param maxRank: int |
313 | 313 |
|
314 | | - .. attribute:: var axes: maxRank*int |
| 314 | + .. data:: config var axes: maxRank*int |
315 | 315 |
|
316 | | - .. attribute:: var input: shared BaseTensorResource(eltType, rank) |
| 316 | + .. data:: config var input: shared BaseTensorResource(eltType, rank) |
317 | 317 |
|
318 | 318 | .. method:: proc children |
319 | 319 |
|
|
323 | 323 |
|
324 | 324 | .. record:: conv2DOp : serializable |
325 | 325 |
|
326 | | - .. attribute:: type eltType = real |
| 326 | + .. type:: config type eltType = real |
327 | 327 |
|
328 | | - .. attribute:: var features: shared BaseTensorResource(eltType, 3) |
| 328 | + .. data:: config var features: shared BaseTensorResource(eltType, 3) |
329 | 329 |
|
330 | | - .. attribute:: var kernel: shared BaseTensorResource(eltType, 4) |
| 330 | + .. data:: config var kernel: shared BaseTensorResource(eltType, 4) |
331 | 331 |
|
332 | | - .. attribute:: var stride: int |
| 332 | + .. data:: config var stride: int |
333 | 333 |
|
334 | 334 | .. method:: proc children |
335 | 335 |
|
|
0 commit comments