oarust 0.9.0

GPU-first semantic computing engine written in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
// schema=sessions.json,codecs.json,ml_parity.json schema_version=1 generator_version=64
// schema_sha256=d4e3a6e7b677bb3cfd2d5a9d46e4bc5f8b10f8e88c5292959d42456422c21a4b
use crate::ml::checkpoint::{CheckpointManager, CheckpointManagerConfig};
use crate::ml::environment::{
	EnvironmentExecution, TradingConfig, TradingEnvironment, TradingSeries,
};
use crate::ml::matrix::UpsampleMode;
use crate::ml::nn::{
	AdaptiveAvgPool2d, AttentionBackend, AttentionMode, AvgPool2d, BatchNorm2d, ByteEmbedding,
	ByteHead, CausalLinearAttention, Conv1d, Conv2d, ConvTranspose1d, ConvTranspose2d, Dropout,
	Embedding, Empyrealm, Ffn, Flatten, FlowDenoiser, FlowDenoiserConfig, FlowTimeEmbedding,
	FlowTransformer, FlowTransformerConfig, Gelu, Gru, GruCell, Identity, LayerNorm, Linear,
	LinearAttentionMode, LogSoftmax, Mamba3, Mamba3Config, Mamba3State, MaxPool2d, Moe,
	MoeRouteStats, MultiHeadAttention, Relu, ResidualVectorQuantizer, ResidualVqResult, RmsNorm, Rnn,
	RnnCell, Rope, Sequential, Silu, Softmax, Swiglu, Transformer, TransformerBlock, Upsample,
	VectorQuantizer, VectorQuantizerConfig, VqResult,
};
use crate::ml::{Module, Parameter};
use crate::{Engine, Matrix, Result};
use std::rc::Rc;

#[allow(clippy::type_complexity)]
const _: fn(&Engine) -> EnvironmentExecution = crate::ml::environment::EnvironmentExecution::new;
#[allow(clippy::type_complexity)]
const _: fn(
	&'static Engine,
	TradingConfig,
	&[TradingSeries],
) -> Result<TradingEnvironment<'static>> = crate::ml::environment::TradingEnvironment::new;
#[allow(clippy::type_complexity)]
const _: fn(
	&'static Engine,
	TradingConfig,
	&[TradingSeries],
	usize,
) -> Result<TradingEnvironment<'static>> =
	crate::ml::environment::TradingEnvironment::new_with_row_capacity;
#[allow(clippy::type_complexity)]
const _: fn(&'static Engine, CheckpointManagerConfig) -> Result<CheckpointManager<'static>> =
	crate::ml::checkpoint::CheckpointManager::new;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix) -> Result<Matrix> = crate::ml::matrix::gelu;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix) -> Result<Matrix> = crate::ml::matrix::silu;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix) -> Result<Matrix> = crate::ml::matrix::relu;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix) -> Result<Matrix> = crate::ml::matrix::tanh;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix) -> Result<Matrix> = crate::ml::matrix::sigmoid;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix, f32) -> Result<Matrix> = crate::ml::matrix::leaky_relu;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix, f32) -> Result<Matrix> = crate::ml::matrix::elu;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix) -> Result<Matrix> = crate::ml::matrix::mish;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix) -> Result<Matrix> = crate::ml::matrix::softplus;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix, usize, usize, f32, u32) -> Result<Matrix> = crate::ml::matrix::rope;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix, &Matrix) -> Result<Matrix> = crate::ml::matrix::swiglu;
#[allow(clippy::type_complexity)]
const _: fn(&Matrix, usize) -> Result<Matrix> = crate::ml::matrix::silu_mul;
#[allow(clippy::type_complexity)]
const _: fn(&Relu, &Matrix) -> Result<Matrix> = crate::ml::nn::Relu::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Gelu, &Matrix) -> Result<Matrix> = crate::ml::nn::Gelu::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Silu, &Matrix) -> Result<Matrix> = crate::ml::nn::Silu::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, u64) -> Result<MultiHeadAttention> =
	crate::ml::nn::MultiHeadAttention::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, bool, u64) -> Result<MultiHeadAttention> =
	crate::ml::nn::MultiHeadAttention::new_with_seed_and_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, f32, bool, u64) -> Result<MultiHeadAttention> =
	crate::ml::nn::MultiHeadAttention::new_with_seed_and_options;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention, &Matrix) -> Result<Matrix> =
	crate::ml::nn::MultiHeadAttention::forward;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention, &Matrix, &Matrix) -> Result<Matrix> =
	crate::ml::nn::MultiHeadAttention::forward_masked;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention, AttentionBackend) -> () =
	crate::ml::nn::MultiHeadAttention::set_backend;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention) -> AttentionBackend = crate::ml::nn::MultiHeadAttention::backend;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention) -> AttentionBackend =
	crate::ml::nn::MultiHeadAttention::last_backend;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention, AttentionMode) -> () = crate::ml::nn::MultiHeadAttention::set_mode;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention) -> AttentionMode = crate::ml::nn::MultiHeadAttention::mode;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention) -> usize = crate::ml::nn::MultiHeadAttention::sequence_length;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention, usize) -> Result<()> =
	crate::ml::nn::MultiHeadAttention::set_sequence_length;
#[allow(clippy::type_complexity)]
const _: fn(&MultiHeadAttention) -> bool = crate::ml::nn::MultiHeadAttention::has_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, u64) -> Result<CausalLinearAttention> =
	crate::ml::nn::CausalLinearAttention::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, bool, u64) -> Result<CausalLinearAttention> =
	crate::ml::nn::CausalLinearAttention::new_with_seed_and_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, bool, u64) -> Result<CausalLinearAttention> =
	crate::ml::nn::CausalLinearAttention::new_with_seed_and_options;
#[allow(clippy::type_complexity)]
const _: fn(&CausalLinearAttention, &Matrix) -> Result<Matrix> =
	crate::ml::nn::CausalLinearAttention::forward;
#[allow(clippy::type_complexity)]
const _: fn(&CausalLinearAttention, LinearAttentionMode) -> () =
	crate::ml::nn::CausalLinearAttention::set_mode;
#[allow(clippy::type_complexity)]
const _: fn(&CausalLinearAttention) -> LinearAttentionMode =
	crate::ml::nn::CausalLinearAttention::mode;
#[allow(clippy::type_complexity)]
const _: fn(&CausalLinearAttention) -> usize =
	crate::ml::nn::CausalLinearAttention::sequence_length;
#[allow(clippy::type_complexity)]
const _: fn(&CausalLinearAttention, usize) -> Result<()> =
	crate::ml::nn::CausalLinearAttention::set_sequence_length;
#[allow(clippy::type_complexity)]
const _: fn(&CausalLinearAttention) -> bool = crate::ml::nn::CausalLinearAttention::has_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize) -> Result<BatchNorm2d> = crate::ml::nn::BatchNorm2d::new;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, f32, f32) -> Result<BatchNorm2d> =
	crate::ml::nn::BatchNorm2d::new_with_options;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, Matrix, Matrix, f32, f32) -> Result<BatchNorm2d> =
	crate::ml::nn::BatchNorm2d::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(&BatchNorm2d, &Matrix) -> Result<Matrix> = crate::ml::nn::BatchNorm2d::forward;
#[allow(clippy::type_complexity)]
const _: fn(&BatchNorm2d) -> Parameter = crate::ml::nn::BatchNorm2d::weight;
#[allow(clippy::type_complexity)]
const _: fn(&BatchNorm2d) -> Parameter = crate::ml::nn::BatchNorm2d::bias;
#[allow(clippy::type_complexity)]
const _: fn(&BatchNorm2d) -> Matrix = crate::ml::nn::BatchNorm2d::running_mean;
#[allow(clippy::type_complexity)]
const _: fn(&BatchNorm2d) -> Matrix = crate::ml::nn::BatchNorm2d::running_variance;
#[allow(clippy::type_complexity)]
const _: fn(&BatchNorm2d) -> [Parameter; 2] = crate::ml::nn::BatchNorm2d::parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, u64) -> Result<ByteEmbedding> =
	crate::ml::nn::ByteEmbedding::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(Matrix) -> Result<ByteEmbedding> = crate::ml::nn::ByteEmbedding::new_from_matrix;
#[allow(clippy::type_complexity)]
const _: fn(&ByteEmbedding, &Matrix) -> Result<Matrix> = crate::ml::nn::ByteEmbedding::forward;
#[allow(clippy::type_complexity)]
const _: fn(&ByteEmbedding) -> Parameter = crate::ml::nn::ByteEmbedding::weight;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, u64) -> Result<ByteHead> = crate::ml::nn::ByteHead::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&ByteHead, &Matrix) -> Result<Matrix> = crate::ml::nn::ByteHead::forward;
#[allow(clippy::type_complexity)]
const _: fn(&ByteHead) -> Parameter = crate::ml::nn::ByteHead::weight;
#[allow(clippy::type_complexity)]
const _: fn(&ByteHead) -> Parameter = crate::ml::nn::ByteHead::bias;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, usize, usize, usize, u64) -> Result<Conv1d> =
	crate::ml::nn::Conv1d::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, usize, usize, usize) -> Result<Conv1d> =
	crate::ml::nn::Conv1d::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(&Conv1d, &Matrix) -> Result<Matrix> = crate::ml::nn::Conv1d::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Conv1d) -> Parameter = crate::ml::nn::Conv1d::weight;
#[allow(clippy::type_complexity)]
const _: fn(&Conv1d) -> Parameter = crate::ml::nn::Conv1d::bias;
#[allow(clippy::type_complexity)]
const _: fn(&Conv1d) -> [Parameter; 2] = crate::ml::nn::Conv1d::parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, usize, usize, u64) -> Result<ConvTranspose1d> =
	crate::ml::nn::ConvTranspose1d::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, usize, usize) -> Result<ConvTranspose1d> =
	crate::ml::nn::ConvTranspose1d::new_from_matrix;
#[allow(clippy::type_complexity)]
const _: fn(&ConvTranspose1d, &Matrix) -> Result<Matrix> = crate::ml::nn::ConvTranspose1d::forward;
#[allow(clippy::type_complexity)]
const _: fn(&ConvTranspose1d) -> Parameter = crate::ml::nn::ConvTranspose1d::weight;
#[allow(clippy::type_complexity)]
const _: fn(&ConvTranspose1d) -> [Parameter; 1] = crate::ml::nn::ConvTranspose1d::parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, usize, usize, u64) -> Result<ConvTranspose2d> =
	crate::ml::nn::ConvTranspose2d::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, usize, usize) -> Result<ConvTranspose2d> =
	crate::ml::nn::ConvTranspose2d::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(&ConvTranspose2d, &Matrix) -> Result<Matrix> = crate::ml::nn::ConvTranspose2d::forward;
#[allow(clippy::type_complexity)]
const _: fn(&ConvTranspose2d) -> Parameter = crate::ml::nn::ConvTranspose2d::weight;
#[allow(clippy::type_complexity)]
const _: fn(&ConvTranspose2d) -> Parameter = crate::ml::nn::ConvTranspose2d::bias;
#[allow(clippy::type_complexity)]
const _: fn(&ConvTranspose2d) -> [Parameter; 2] = crate::ml::nn::ConvTranspose2d::parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, usize, usize, usize, u64) -> Result<Conv2d> =
	crate::ml::nn::Conv2d::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, usize, usize, usize) -> Result<Conv2d> =
	crate::ml::nn::Conv2d::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(&Conv2d, &Matrix) -> Result<Matrix> = crate::ml::nn::Conv2d::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Conv2d) -> Parameter = crate::ml::nn::Conv2d::weight;
#[allow(clippy::type_complexity)]
const _: fn(&Conv2d) -> Parameter = crate::ml::nn::Conv2d::bias;
#[allow(clippy::type_complexity)]
const _: fn(&Conv2d) -> [Parameter; 2] = crate::ml::nn::Conv2d::parameters;
#[allow(clippy::type_complexity)]
const _: fn(f32) -> Result<Dropout> = crate::ml::nn::Dropout::new;
#[allow(clippy::type_complexity)]
const _: fn(f32, u64) -> Result<Dropout> = crate::ml::nn::Dropout::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Dropout, &Matrix) -> Result<Matrix> = crate::ml::nn::Dropout::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, u64) -> Result<Embedding> =
	crate::ml::nn::Embedding::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(Matrix) -> Result<Embedding> = crate::ml::nn::Embedding::new_from_matrix;
#[allow(clippy::type_complexity)]
const _: fn(&Embedding, &Matrix) -> Result<Matrix> = crate::ml::nn::Embedding::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Embedding) -> Parameter = crate::ml::nn::Embedding::weight;
#[allow(clippy::type_complexity)]
const _: fn(&Embedding) -> [Parameter; 1] = crate::ml::nn::Embedding::parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, Mamba3Config, u64) -> Result<Empyrealm> =
	crate::ml::nn::Empyrealm::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Empyrealm, &Matrix) -> Result<Matrix> = crate::ml::nn::Empyrealm::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Empyrealm, &Matrix) -> Result<Matrix> = crate::ml::nn::Empyrealm::forward_embedded;
#[allow(clippy::type_complexity)]
const _: fn(&Empyrealm, usize) -> Result<Mamba3State> = crate::ml::nn::Empyrealm::new_state;
#[allow(clippy::type_complexity)]
const _: fn(&Empyrealm, &Matrix, &mut Mamba3State) -> Result<Matrix> =
	crate::ml::nn::Empyrealm::step_embedded;
#[allow(clippy::type_complexity)]
const _: fn(&Empyrealm) -> &Mamba3 = crate::ml::nn::Empyrealm::mixer;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, f32, u64) -> Result<Ffn> = crate::ml::nn::Ffn::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Ffn, &Matrix) -> Result<Matrix> = crate::ml::nn::Ffn::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, f32, f32) -> Result<FlowTimeEmbedding> =
	crate::ml::nn::FlowTimeEmbedding::new;
#[allow(clippy::type_complexity)]
const _: fn(&FlowTimeEmbedding, &Matrix) -> Result<Matrix> =
	crate::ml::nn::FlowTimeEmbedding::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, FlowTransformerConfig, u64) -> Result<FlowTransformer> =
	crate::ml::nn::FlowTransformer::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&FlowTransformer, &Matrix) -> Result<Matrix> = crate::ml::nn::FlowTransformer::forward;
#[allow(clippy::type_complexity)]
const _: fn(&FlowTransformer, &Matrix, &Matrix) -> Result<Matrix> =
	crate::ml::nn::FlowTransformer::forward_masked;
#[allow(clippy::type_complexity)]
const _: fn(&FlowTransformer, &Matrix, &Matrix, Option<&Matrix>) -> Result<Matrix> =
	crate::ml::nn::FlowTransformer::forward_conditioned;
#[allow(clippy::type_complexity)]
const _: fn(&FlowTransformer, usize) -> Result<()> =
	crate::ml::nn::FlowTransformer::set_sequence_length;
#[allow(clippy::type_complexity)]
const _: fn(&FlowTransformer) -> FlowTransformerConfig = crate::ml::nn::FlowTransformer::config;
#[allow(clippy::type_complexity)]
const _: fn(&FlowTransformer) -> bool = crate::ml::nn::FlowTransformer::is_moe;
#[allow(clippy::type_complexity)]
const _: fn(&FlowTransformer) -> usize = crate::ml::nn::FlowTransformer::num_layers;
#[allow(clippy::type_complexity)]
const _: fn(&FlowTransformer, usize) -> Option<&TransformerBlock> =
	crate::ml::nn::FlowTransformer::block;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, FlowDenoiserConfig, u64) -> Result<FlowDenoiser> =
	crate::ml::nn::FlowDenoiser::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&FlowDenoiser, &Matrix) -> Result<Matrix> = crate::ml::nn::FlowDenoiser::forward;
#[allow(clippy::type_complexity)]
const _: fn(&FlowDenoiser, &Matrix, &Matrix, Option<&Matrix>, Option<&Matrix>) -> Result<Matrix> =
	crate::ml::nn::FlowDenoiser::forward_conditioned;
#[allow(clippy::type_complexity)]
const _: fn(&FlowDenoiser, &Matrix, &Matrix, &Matrix, f32, Option<&Matrix>) -> Result<Matrix> =
	crate::ml::nn::FlowDenoiser::forward_guided;
#[allow(clippy::type_complexity)]
const _: fn(&FlowDenoiser) -> bool = crate::ml::nn::FlowDenoiser::is_moe;
#[allow(clippy::type_complexity)]
const _: fn(&FlowDenoiser) -> &FlowTransformer = crate::ml::nn::FlowDenoiser::backbone;
#[allow(clippy::type_complexity)]
const _: fn(&FlowDenoiser) -> Parameter = crate::ml::nn::FlowDenoiser::position;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, bool, u64) -> Result<GruCell> =
	crate::ml::nn::GruCell::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, Matrix, Matrix) -> Result<GruCell> =
	crate::ml::nn::GruCell::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix) -> Result<GruCell> = crate::ml::nn::GruCell::new_from_weights;
#[allow(clippy::type_complexity)]
const _: fn(&GruCell, usize) -> Result<Matrix> = crate::ml::nn::GruCell::zero_state;
#[allow(clippy::type_complexity)]
const _: fn(&GruCell, &Matrix, &Matrix) -> Result<Matrix> = crate::ml::nn::GruCell::step;
#[allow(clippy::type_complexity)]
const _: fn(&GruCell) -> bool = crate::ml::nn::GruCell::has_bias;
#[allow(clippy::type_complexity)]
const _: fn(&GruCell) -> Result<Vec<Parameter>> = crate::ml::nn::GruCell::all_parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, bool, u64) -> Result<Gru> =
	crate::ml::nn::Gru::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, Matrix, Matrix) -> Result<Gru> = crate::ml::nn::Gru::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix) -> Result<Gru> = crate::ml::nn::Gru::new_from_weights;
#[allow(clippy::type_complexity)]
const _: fn(&Gru, &Matrix) -> Result<Matrix> = crate::ml::nn::Gru::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Gru) -> usize = crate::ml::nn::Gru::num_layers;
#[allow(clippy::type_complexity)]
const _: fn(&Gru) -> bool = crate::ml::nn::Gru::has_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Gru) -> Result<Vec<Parameter>> = crate::ml::nn::Gru::all_parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Gru, usize) -> Option<Vec<Parameter>> = crate::ml::nn::Gru::layer_parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, f32) -> Result<LayerNorm> = crate::ml::nn::LayerNorm::new;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, f32) -> Result<LayerNorm> = crate::ml::nn::LayerNorm::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(&LayerNorm, &Matrix) -> Result<Matrix> = crate::ml::nn::LayerNorm::forward;
#[allow(clippy::type_complexity)]
const _: fn(&LayerNorm, &Matrix) -> Result<Matrix> = crate::ml::nn::LayerNorm::forward_channel;
#[allow(clippy::type_complexity)]
const _: fn(&LayerNorm, &Matrix) -> Result<Matrix> = crate::ml::nn::LayerNorm::forward_channel_relu;
#[allow(clippy::type_complexity)]
const _: fn(&LayerNorm) -> Parameter = crate::ml::nn::LayerNorm::weight;
#[allow(clippy::type_complexity)]
const _: fn(&LayerNorm) -> Parameter = crate::ml::nn::LayerNorm::bias;
#[allow(clippy::type_complexity)]
const _: fn(&LayerNorm) -> [Parameter; 2] = crate::ml::nn::LayerNorm::parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, u64) -> Result<Linear> = crate::ml::nn::Linear::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, bool, u64) -> Result<Linear> =
	crate::ml::nn::Linear::new_with_seed_and_bias;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix) -> Result<Linear> = crate::ml::nn::Linear::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(Matrix) -> Result<Linear> = crate::ml::nn::Linear::new_from_weight;
#[allow(clippy::type_complexity)]
const _: fn(&Linear, &Matrix) -> Result<Matrix> = crate::ml::nn::Linear::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Linear) -> Parameter = crate::ml::nn::Linear::weight;
#[allow(clippy::type_complexity)]
const _: fn(&Linear) -> Option<Parameter> = crate::ml::nn::Linear::bias;
#[allow(clippy::type_complexity)]
const _: fn(&Linear) -> bool = crate::ml::nn::Linear::has_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Linear) -> Vec<Parameter> = crate::ml::nn::Linear::parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, Mamba3Config, u64) -> Result<Mamba3> = crate::ml::nn::Mamba3::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Mamba3, &Matrix) -> Result<Matrix> = crate::ml::nn::Mamba3::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Mamba3, usize) -> Result<Mamba3State> = crate::ml::nn::Mamba3::new_state;
#[allow(clippy::type_complexity)]
const _: fn(&Mamba3, &Matrix, &mut Mamba3State) -> Result<Matrix> = crate::ml::nn::Mamba3::step;
#[allow(clippy::type_complexity)]
const _: fn(&Mamba3) -> Vec<Parameter> = crate::ml::nn::Mamba3::parameters;
#[allow(clippy::type_complexity)]
const _: fn(&MoeRouteStats) -> &[f32] = crate::ml::nn::MoeRouteStats::load_fraction;
#[allow(clippy::type_complexity)]
const _: fn(&MoeRouteStats) -> &[f32] = crate::ml::nn::MoeRouteStats::mean_probability;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, usize, f32, u64) -> Result<Moe> =
	crate::ml::nn::Moe::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, usize, f32, usize, u64) -> Result<Moe> =
	crate::ml::nn::Moe::new_with_seed_and_shared_experts;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, Matrix, Matrix, Matrix, Matrix, Matrix, usize, f32) -> Result<Moe> =
	crate::ml::nn::Moe::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(&Moe, &Matrix) -> Result<Matrix> = crate::ml::nn::Moe::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Moe, bool) -> () = crate::ml::nn::Moe::set_sparse_execution;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> bool = crate::ml::nn::Moe::sparse_execution;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> usize = crate::ml::nn::Moe::num_shared_experts;
#[allow(clippy::type_complexity)]
const _: fn(&Moe, f32) -> () = crate::ml::nn::Moe::set_balance_rate;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> f32 = crate::ml::nn::Moe::balance_rate;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Matrix = crate::ml::nn::Moe::routing_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Moe, f32) -> () = crate::ml::nn::Moe::set_aux_loss_alpha;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> f32 = crate::ml::nn::Moe::aux_loss_alpha;
#[allow(clippy::type_complexity)]
const _: fn(&Moe, f32) -> () = crate::ml::nn::Moe::set_router_z_loss_beta;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> f32 = crate::ml::nn::Moe::router_z_loss_beta;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Matrix = crate::ml::nn::Moe::aux_loss;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Result<()> = crate::ml::nn::Moe::update_routing_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Option<Matrix> = crate::ml::nn::Moe::last_selection_mask;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Option<Matrix> = crate::ml::nn::Moe::last_gate_probabilities;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Result<MoeRouteStats> = crate::ml::nn::Moe::route_stats;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Parameter = crate::ml::nn::Moe::expert_gate_up_weight;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Parameter = crate::ml::nn::Moe::expert_gate_up_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Parameter = crate::ml::nn::Moe::expert_down_weight;
#[allow(clippy::type_complexity)]
const _: fn(&Moe) -> Parameter = crate::ml::nn::Moe::expert_down_bias;
#[allow(clippy::type_complexity)]
const _: fn(usize) -> Result<AvgPool2d> = crate::ml::nn::AvgPool2d::new;
#[allow(clippy::type_complexity)]
const _: fn(usize, usize, usize) -> Result<AvgPool2d> = crate::ml::nn::AvgPool2d::new_with_options;
#[allow(clippy::type_complexity)]
const _: fn(&AvgPool2d, &Matrix) -> Result<Matrix> = crate::ml::nn::AvgPool2d::forward;
#[allow(clippy::type_complexity)]
const _: fn(usize) -> Result<MaxPool2d> = crate::ml::nn::MaxPool2d::new;
#[allow(clippy::type_complexity)]
const _: fn(usize, usize, usize) -> Result<MaxPool2d> = crate::ml::nn::MaxPool2d::new_with_options;
#[allow(clippy::type_complexity)]
const _: fn(&MaxPool2d, &Matrix) -> Result<Matrix> = crate::ml::nn::MaxPool2d::forward;
#[allow(clippy::type_complexity)]
const _: fn(usize) -> Result<AdaptiveAvgPool2d> = crate::ml::nn::AdaptiveAvgPool2d::new;
#[allow(clippy::type_complexity)]
const _: fn(usize, usize) -> Result<AdaptiveAvgPool2d> =
	crate::ml::nn::AdaptiveAvgPool2d::new_with_output_size;
#[allow(clippy::type_complexity)]
const _: fn(&AdaptiveAvgPool2d, &Matrix) -> Result<Matrix> =
	crate::ml::nn::AdaptiveAvgPool2d::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, f32) -> Result<RmsNorm> = crate::ml::nn::RmsNorm::new;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, f32) -> Result<RmsNorm> = crate::ml::nn::RmsNorm::new_from_matrix;
#[allow(clippy::type_complexity)]
const _: fn(&RmsNorm, &Matrix) -> Result<Matrix> = crate::ml::nn::RmsNorm::forward;
#[allow(clippy::type_complexity)]
const _: fn(&RmsNorm) -> Parameter = crate::ml::nn::RmsNorm::weight;
#[allow(clippy::type_complexity)]
const _: fn(&RmsNorm) -> [Parameter; 1] = crate::ml::nn::RmsNorm::parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, bool, u64) -> Result<RnnCell> =
	crate::ml::nn::RnnCell::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, Matrix, Matrix) -> Result<RnnCell> =
	crate::ml::nn::RnnCell::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix) -> Result<RnnCell> = crate::ml::nn::RnnCell::new_from_weights;
#[allow(clippy::type_complexity)]
const _: fn(&RnnCell, usize) -> Result<Matrix> = crate::ml::nn::RnnCell::zero_state;
#[allow(clippy::type_complexity)]
const _: fn(&RnnCell, &Matrix, &Matrix) -> Result<Matrix> = crate::ml::nn::RnnCell::step;
#[allow(clippy::type_complexity)]
const _: fn(&RnnCell) -> bool = crate::ml::nn::RnnCell::has_bias;
#[allow(clippy::type_complexity)]
const _: fn(&RnnCell) -> Result<Vec<Parameter>> = crate::ml::nn::RnnCell::all_parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, u64) -> Result<Rnn> = crate::ml::nn::Rnn::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, bool, u64) -> Result<Rnn> =
	crate::ml::nn::Rnn::new_with_seed_and_bias;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix, Matrix, Matrix) -> Result<Rnn> = crate::ml::nn::Rnn::new_from_matrices;
#[allow(clippy::type_complexity)]
const _: fn(Matrix, Matrix) -> Result<Rnn> = crate::ml::nn::Rnn::new_from_weights;
#[allow(clippy::type_complexity)]
const _: fn(&Rnn, &Matrix) -> Result<Matrix> = crate::ml::nn::Rnn::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Rnn) -> usize = crate::ml::nn::Rnn::num_layers;
#[allow(clippy::type_complexity)]
const _: fn(&Rnn) -> bool = crate::ml::nn::Rnn::has_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Rnn) -> Result<Vec<Parameter>> = crate::ml::nn::Rnn::all_parameters;
#[allow(clippy::type_complexity)]
const _: fn(&Rnn, usize) -> Option<Vec<Parameter>> = crate::ml::nn::Rnn::layer_parameters;
#[allow(clippy::type_complexity)]
const _: fn(usize, usize, f32) -> Result<Rope> = crate::ml::nn::Rope::new;
#[allow(clippy::type_complexity)]
const _: fn(&Rope, &Matrix) -> Result<Matrix> = crate::ml::nn::Rope::forward;
#[allow(clippy::type_complexity)]
const _: fn(&mut Sequential, Rc<dyn Module>) -> Result<&mut Sequential> =
	crate::ml::nn::Sequential::add;
#[allow(clippy::type_complexity)]
const _: fn(&Sequential) -> usize = crate::ml::nn::Sequential::len;
#[allow(clippy::type_complexity)]
const _: fn(&Sequential) -> bool = crate::ml::nn::Sequential::is_empty;
#[allow(clippy::type_complexity)]
const _: fn(&Sequential, &Matrix) -> Result<Matrix> = crate::ml::nn::Sequential::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Softmax, &Matrix) -> Result<Matrix> = crate::ml::nn::Softmax::forward;
#[allow(clippy::type_complexity)]
const _: fn(&LogSoftmax, &Matrix) -> Result<Matrix> = crate::ml::nn::LogSoftmax::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, bool, u64) -> Result<Swiglu> =
	crate::ml::nn::Swiglu::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Swiglu, &Matrix) -> Result<Matrix> = crate::ml::nn::Swiglu::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Swiglu) -> bool = crate::ml::nn::Swiglu::has_bias;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, usize, f32, u64) -> Result<TransformerBlock> =
	crate::ml::nn::TransformerBlock::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, usize, usize, f32, u64) -> Result<TransformerBlock> =
	crate::ml::nn::TransformerBlock::new_with_seed_conditioned;
#[allow(clippy::type_complexity)]
const _: fn(
	&Engine,
	usize,
	usize,
	usize,
	usize,
	usize,
	usize,
	f32,
	u64,
) -> Result<TransformerBlock> = crate::ml::nn::TransformerBlock::new_with_seed_moe;
#[allow(clippy::type_complexity)]
const _: fn(
	&Engine,
	usize,
	usize,
	usize,
	usize,
	usize,
	usize,
	usize,
	f32,
	u64,
) -> Result<TransformerBlock> = crate::ml::nn::TransformerBlock::new_with_seed_moe_conditioned;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock, &Matrix) -> Result<Matrix> =
	crate::ml::nn::TransformerBlock::forward;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock, &Matrix, &Matrix) -> Result<Matrix> =
	crate::ml::nn::TransformerBlock::forward_masked;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock, &Matrix, &Matrix) -> Result<Matrix> =
	crate::ml::nn::TransformerBlock::forward_conditioned;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock, &Matrix, &Matrix, &Matrix) -> Result<Matrix> =
	crate::ml::nn::TransformerBlock::forward_conditioned_masked;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock) -> usize = crate::ml::nn::TransformerBlock::sequence_length;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock) -> bool = crate::ml::nn::TransformerBlock::is_moe;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock) -> Option<&Moe> = crate::ml::nn::TransformerBlock::moe;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock) -> bool = crate::ml::nn::TransformerBlock::is_adaptively_conditioned;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock, AttentionMode) -> () =
	crate::ml::nn::TransformerBlock::set_attention_mode;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock) -> AttentionMode = crate::ml::nn::TransformerBlock::attention_mode;
#[allow(clippy::type_complexity)]
const _: fn(&TransformerBlock, usize) -> Result<()> =
	crate::ml::nn::TransformerBlock::set_sequence_length;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, usize, usize, usize, usize, usize, usize, f32, u64) -> Result<Transformer> =
	crate::ml::nn::Transformer::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(
	&Engine,
	usize,
	usize,
	usize,
	usize,
	usize,
	usize,
	usize,
	usize,
	f32,
	u64,
) -> Result<Transformer> = crate::ml::nn::Transformer::new_with_seed_moe;
#[allow(clippy::type_complexity)]
const _: fn(&Transformer, &Matrix) -> Result<Matrix> = crate::ml::nn::Transformer::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Transformer) -> usize = crate::ml::nn::Transformer::num_layers;
#[allow(clippy::type_complexity)]
const _: fn(&Transformer) -> bool = crate::ml::nn::Transformer::is_moe;
#[allow(clippy::type_complexity)]
const _: fn(&Transformer, usize) -> Option<&TransformerBlock> = crate::ml::nn::Transformer::block;
#[allow(clippy::type_complexity)]
const _: fn(usize) -> Result<Upsample> = crate::ml::nn::Upsample::new;
#[allow(clippy::type_complexity)]
const _: fn(usize, UpsampleMode) -> Result<Upsample> = crate::ml::nn::Upsample::new_with_mode;
#[allow(clippy::type_complexity)]
const _: fn(&Upsample, &Matrix) -> Result<Matrix> = crate::ml::nn::Upsample::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Identity, &Matrix) -> Result<Matrix> = crate::ml::nn::Identity::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Flatten, &Matrix) -> Result<Matrix> = crate::ml::nn::Flatten::forward;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, VectorQuantizerConfig, u64) -> Result<VectorQuantizer> =
	crate::ml::nn::VectorQuantizer::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, VectorQuantizerConfig) -> Result<VectorQuantizer> =
	crate::ml::nn::VectorQuantizer::new;
#[allow(clippy::type_complexity)]
const _: fn(&VectorQuantizer, &Matrix) -> Result<VqResult> =
	crate::ml::nn::VectorQuantizer::quantize;
#[allow(clippy::type_complexity)]
const _: fn(&VectorQuantizer, &Matrix, &Matrix) -> Result<()> =
	crate::ml::nn::VectorQuantizer::ema_update;
#[allow(clippy::type_complexity)]
const _: fn(&VectorQuantizer, &Matrix) -> Result<Matrix> = crate::ml::nn::VectorQuantizer::lookup;
#[allow(clippy::type_complexity)]
const _: fn(&VectorQuantizer, &Matrix) -> Result<()> = crate::ml::nn::VectorQuantizer::seed;
#[allow(clippy::type_complexity)]
const _: fn(&VectorQuantizer) -> Matrix = crate::ml::nn::VectorQuantizer::codebook;
#[allow(clippy::type_complexity)]
const _: fn(&VectorQuantizer) -> u32 = crate::ml::nn::VectorQuantizer::ema_step;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, VectorQuantizerConfig, usize, u64) -> Result<ResidualVectorQuantizer> =
	crate::ml::nn::ResidualVectorQuantizer::new_with_seed;
#[allow(clippy::type_complexity)]
const _: fn(&Engine, VectorQuantizerConfig, usize) -> Result<ResidualVectorQuantizer> =
	crate::ml::nn::ResidualVectorQuantizer::new;
#[allow(clippy::type_complexity)]
const _: fn(&ResidualVectorQuantizer, &Matrix) -> Result<ResidualVqResult> =
	crate::ml::nn::ResidualVectorQuantizer::quantize;
#[allow(clippy::type_complexity)]
const _: fn(&ResidualVectorQuantizer, &ResidualVqResult) -> Result<()> =
	crate::ml::nn::ResidualVectorQuantizer::ema_update;
#[allow(clippy::type_complexity)]
const _: fn(&ResidualVectorQuantizer, &[Matrix]) -> Result<Matrix> =
	crate::ml::nn::ResidualVectorQuantizer::lookup;
#[allow(clippy::type_complexity)]
const _: fn(&ResidualVectorQuantizer, &Matrix) -> Result<()> =
	crate::ml::nn::ResidualVectorQuantizer::seed;
#[allow(clippy::type_complexity)]
const _: fn(&ResidualVectorQuantizer) -> usize = crate::ml::nn::ResidualVectorQuantizer::num_levels;
#[allow(clippy::type_complexity)]
const _: fn(&ResidualVectorQuantizer, usize) -> Option<&VectorQuantizer> =
	crate::ml::nn::ResidualVectorQuantizer::level;