@@ -21,6 +21,12 @@ Emulate NumPy user-facing API as much as possible.
21
21
22
22
** Uses pre-commit with ruff**
23
23
24
+ ** Performance**
25
+ * Could should be performant
26
+ * Avoid expensive work in hot loops
27
+ * Avoid redundant checks. Let errors raise naturally
28
+ * In contrast, silent errors should be prevented
29
+
24
30
** Comments** : Should be used sparingly, only for complex logic
25
31
26
32
** Testing** : Should be succinct
@@ -44,7 +50,7 @@ Emulate NumPy user-facing API as much as possible.
44
50
- ` gradient.py ` : Auto-differentiation
45
51
- ` compile/ ` : Function compilation
46
52
- ` graph/ ` : IR and optimization (` graph/rewriting/ ` )
47
- - ` link/ ` : Backends (` c/ ` , ` jax/ ` , ` numba/ ` , ` pytorch/ ` )
53
+ - ` link/ ` : Backends (` c/ ` , ` jax/ ` , ` numba/ ` , ` mlx/ ` , ` pytorch/ ` )
48
54
- ` tensor/ ` : Tensor ops (largest module, subdirs: ` random/ ` , ` rewriting/ ` , ` conv/ ` )
49
55
- ` scalar/ ` : Scalar ops
50
56
- ` scan/ ` : Loop operations (` scan_perform.pyx ` Cython)
@@ -74,7 +80,7 @@ micromamba run -n pytensor-test python -m pytest tests/ --runslow # Include s
74
80
75
81
Tests are run with ` config.floatX == "float32" ` and ` config.mode = "FAST_COMPILE" ` . If needed:
76
82
- Cast numerical values ` test_value.astype(symbolic_var.type.dtype) `
77
- - Use custom function mode ` get_default_mode().excluding("fusion") ` or skip tests in ` FAST_COMPILE `
83
+ - Use custom function mode ` get_default_mode().excluding("fusion") ` or skip tests in ` FAST_COMPILE ` if they are not directly relevant to the mode.
78
84
79
85
Alternative backends (JAX, NUMBA, ...) are optional. Use ` pytest.importorskip ` to fail gracefully.
80
86
0 commit comments