haliax 1.4.dev405__tar.gz → 1.4.dev407__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- haliax-1.4.dev407/.agents/projects/api_parity.md +215 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/PKG-INFO +1 -1
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/api.md +3 -0
- haliax-1.4.dev407/src/haliax/__about__.py +1 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/__init__.py +6 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/ops.py +23 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_ops.py +26 -0
- haliax-1.4.dev405/src/haliax/__about__.py +0 -1
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.coveragerc +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.flake8 +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.github/workflows/publish_dev.yaml +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.github/workflows/run_pre_commit.yaml +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.github/workflows/run_quick_levanter_tests.yaml +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.github/workflows/run_tests.yaml +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.gitignore +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.playbooks/add-types.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.playbooks/wrap-non-named.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.pre-commit-config.yaml +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/.readthedocs.yaml +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/AGENTS.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/CONTRIBUTING.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/LICENSE +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/README.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/broadcasting.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/cheatsheet.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/css/material.css +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/css/mkdocstrings.css +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/faq.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/data_parallel_mesh.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/data_parallel_mesh_replicated.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/device_mesh_1d.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/device_mesh_1d_zero.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/device_mesh_2d.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/device_mesh_2d_batch_partitioned.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/device_mesh_2d_data_replicated.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/device_mesh_2d_data_replicated_mlp_partitioned.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/device_mesh_2d_intermediate_fully_partitioned.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/figures/device_mesh_2d_zero.png +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/fp8.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/index.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/indexing.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/matmul.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/nn.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/partitioning.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/primer.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/rearrange.ipynb +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/rearrange.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/requirements.txt +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/scan.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/state-dict.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/tutorial.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/typing.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/docs/vmap.md +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/mkdocs.yml +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/pyproject.toml +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/__init__.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/compile_utils.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/dot.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/einsum.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/fp8.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/parsing.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/rearrange.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/scan.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/state_dict.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/_src/util.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/axis.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/core.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/debug.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/field.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/haxtyping.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/hof.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/jax_utils.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/__init__.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/activations.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/attention.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/conv.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/dropout.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/embedding.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/linear.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/loss.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/mlp.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/normalization.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/pool.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/nn/scan.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/partitioning.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/quantization.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/random.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/specialized_fns.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/state_dict.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/tree_util.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/types.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/util.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/src/haliax/wrap.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/core_test.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_attention.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_axis.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_conv.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_debug.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_dot.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_dtype_typing.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_einsum.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_field.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_fp8.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_hof.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_int8.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_moe_linear.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_namedarray_typing.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_nn.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_parsing.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_partitioning.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_pool.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_random.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_rearrange.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_scan.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_scatter_gather.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_specialized_fns.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_state_dict.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_tree_util.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_utils.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/tests/test_visualize_sharding.py +0 -0
- {haliax-1.4.dev405 → haliax-1.4.dev407}/uv.lock +0 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# JAX NumPy API Parity
|
|
2
|
+
This document tracks JAX NumPy functions not yet wrapped by Haliax.
|
|
3
|
+
|
|
4
|
+
APIs that don't translate well to named tensors are intentionally omitted here. This includes dtype constructors, raw array converters (e.g. `from_dlpack`), indexing helpers like `c_`/`r_`, and functions whose JAX counterparts already work with `NamedArray` out of the box. Basic array construction is handled by `haliax.named`, so functions such as `array` or `asarray` are not listed.
|
|
5
|
+
|
|
6
|
+
## numpy
|
|
7
|
+
- [x] `allclose`
|
|
8
|
+
- [ ] `amin`
|
|
9
|
+
- [ ] `append`
|
|
10
|
+
- [ ] `apply_along_axis`
|
|
11
|
+
- [ ] `apply_over_axes`
|
|
12
|
+
- [ ] `argpartition`
|
|
13
|
+
- [ ] `argwhere`
|
|
14
|
+
- [x] `array_equal`
|
|
15
|
+
- [x] `array_equiv`
|
|
16
|
+
- [ ] `array_split`
|
|
17
|
+
- [ ] `astype`
|
|
18
|
+
- [ ] `atan2`
|
|
19
|
+
- [ ] `average`
|
|
20
|
+
- [ ] `bartlett`
|
|
21
|
+
- [ ] `bitwise_count`
|
|
22
|
+
- [ ] `bitwise_invert`
|
|
23
|
+
- [ ] `bitwise_left_shift`
|
|
24
|
+
- [ ] `bitwise_right_shift`
|
|
25
|
+
- [ ] `blackman`
|
|
26
|
+
- [ ] `block`
|
|
27
|
+
- [ ] `broadcast_shapes`
|
|
28
|
+
- [ ] `can_cast`
|
|
29
|
+
- [ ] `choose`
|
|
30
|
+
- [ ] `column_stack`
|
|
31
|
+
- [ ] `compress`
|
|
32
|
+
- [ ] `concat`
|
|
33
|
+
- [ ] `convolve`
|
|
34
|
+
- [ ] `copysign`
|
|
35
|
+
- [ ] `corrcoef`
|
|
36
|
+
- [ ] `correlate`
|
|
37
|
+
- [ ] `count_nonzero`
|
|
38
|
+
- [ ] `cov`
|
|
39
|
+
- [ ] `cumulative_prod`
|
|
40
|
+
- [ ] `cumulative_sum`
|
|
41
|
+
- [ ] `delete`
|
|
42
|
+
- [ ] `diag`
|
|
43
|
+
- [ ] `diag_indices`
|
|
44
|
+
- [ ] `diag_indices_from`
|
|
45
|
+
- [ ] `diagflat`
|
|
46
|
+
- [ ] `diagonal`
|
|
47
|
+
- [ ] `diff`
|
|
48
|
+
- [ ] `digitize`
|
|
49
|
+
- [ ] `dsplit`
|
|
50
|
+
- [ ] `dstack`
|
|
51
|
+
- [ ] `ediff1d`
|
|
52
|
+
- [ ] `einsum_path`
|
|
53
|
+
- [ ] `empty`
|
|
54
|
+
- [ ] `empty_like`
|
|
55
|
+
- [ ] `expand_dims`
|
|
56
|
+
- [ ] `extract`
|
|
57
|
+
- [ ] `eye`
|
|
58
|
+
- [ ] `fill_diagonal`
|
|
59
|
+
- [ ] `flatnonzero`
|
|
60
|
+
- [ ] `flip`
|
|
61
|
+
- [ ] `fliplr`
|
|
62
|
+
- [ ] `flipud`
|
|
63
|
+
- [ ] `gcd`
|
|
64
|
+
- [ ] `gradient`
|
|
65
|
+
- [ ] `hamming`
|
|
66
|
+
- [ ] `hanning`
|
|
67
|
+
- [ ] `heaviside`
|
|
68
|
+
- [ ] `histogram`
|
|
69
|
+
- [ ] `histogram2d`
|
|
70
|
+
- [ ] `histogram_bin_edges`
|
|
71
|
+
- [ ] `histogramdd`
|
|
72
|
+
- [ ] `hsplit`
|
|
73
|
+
- [ ] `hstack`
|
|
74
|
+
- [ ] `identity`
|
|
75
|
+
- [ ] `indices`
|
|
76
|
+
- [ ] `inner`
|
|
77
|
+
- [ ] `insert`
|
|
78
|
+
- [ ] `interp`
|
|
79
|
+
- [ ] `intersect1d`
|
|
80
|
+
- [ ] `iscomplexobj`
|
|
81
|
+
- [ ] `isin`
|
|
82
|
+
- [ ] `iterable`
|
|
83
|
+
- [ ] `ix_`
|
|
84
|
+
- [ ] `kaiser`
|
|
85
|
+
- [ ] `kron`
|
|
86
|
+
- [ ] `lcm`
|
|
87
|
+
- [ ] `ldexp`
|
|
88
|
+
- [ ] `lexsort`
|
|
89
|
+
- [ ] `mask_indices`
|
|
90
|
+
- [ ] `median`
|
|
91
|
+
- [ ] `meshgrid`
|
|
92
|
+
- [ ] `mgrid`
|
|
93
|
+
- [ ] `modf`
|
|
94
|
+
- [ ] `moveaxis`
|
|
95
|
+
- [ ] `nan_to_num`
|
|
96
|
+
- [ ] `nanargmax`
|
|
97
|
+
- [ ] `nanargmin`
|
|
98
|
+
- [ ] `nancumprod`
|
|
99
|
+
- [ ] `nancumsum`
|
|
100
|
+
- [ ] `nanmax`
|
|
101
|
+
- [ ] `nanmean`
|
|
102
|
+
- [ ] `nanmedian`
|
|
103
|
+
- [ ] `nanmin`
|
|
104
|
+
- [ ] `nanpercentile`
|
|
105
|
+
- [ ] `nanprod`
|
|
106
|
+
- [ ] `nanquantile`
|
|
107
|
+
- [ ] `nanstd`
|
|
108
|
+
- [ ] `nansum`
|
|
109
|
+
- [ ] `nanvar`
|
|
110
|
+
- [ ] `nonzero`
|
|
111
|
+
- [ ] `ogrid`
|
|
112
|
+
- [ ] `packbits`
|
|
113
|
+
- [ ] `partition`
|
|
114
|
+
- [ ] `percentile`
|
|
115
|
+
- [ ] `permute_dims`
|
|
116
|
+
- [ ] `piecewise`
|
|
117
|
+
- [ ] `place`
|
|
118
|
+
- [ ] `poly`
|
|
119
|
+
- [ ] `polyadd`
|
|
120
|
+
- [ ] `polyder`
|
|
121
|
+
- [ ] `polydiv`
|
|
122
|
+
- [ ] `polyfit`
|
|
123
|
+
- [ ] `polyint`
|
|
124
|
+
- [ ] `polymul`
|
|
125
|
+
- [ ] `polysub`
|
|
126
|
+
- [ ] `polyval`
|
|
127
|
+
- [ ] `pow`
|
|
128
|
+
- [ ] `promote_types`
|
|
129
|
+
- [ ] `put`
|
|
130
|
+
- [ ] `put_along_axis`
|
|
131
|
+
- [ ] `quantile`
|
|
132
|
+
- [ ] `ravel_multi_index`
|
|
133
|
+
- [ ] `reshape`
|
|
134
|
+
- [ ] `resize`
|
|
135
|
+
- [ ] `result_type`
|
|
136
|
+
- [ ] `rollaxis`
|
|
137
|
+
- [ ] `roots`
|
|
138
|
+
- [ ] `rot90`
|
|
139
|
+
- [ ] `select`
|
|
140
|
+
- [ ] `setdiff1d`
|
|
141
|
+
- [ ] `setxor1d`
|
|
142
|
+
- [ ] `spacing`
|
|
143
|
+
- [ ] `squeeze`
|
|
144
|
+
- [ ] `swapaxes`
|
|
145
|
+
- [ ] `take_along_axis`
|
|
146
|
+
- [ ] `transpose`
|
|
147
|
+
- [ ] `trapezoid`
|
|
148
|
+
- [ ] `tri`
|
|
149
|
+
- [ ] `tril_indices`
|
|
150
|
+
- [ ] `tril_indices_from`
|
|
151
|
+
- [ ] `trim_zeros`
|
|
152
|
+
- [ ] `triu_indices`
|
|
153
|
+
- [ ] `triu_indices_from`
|
|
154
|
+
- [ ] `union1d`
|
|
155
|
+
- [ ] `unpackbits`
|
|
156
|
+
- [ ] `unravel_index`
|
|
157
|
+
- [ ] `unstack`
|
|
158
|
+
- [ ] `unwrap`
|
|
159
|
+
- [ ] `vander`
|
|
160
|
+
- [ ] `vsplit`
|
|
161
|
+
- [ ] `vstack`
|
|
162
|
+
|
|
163
|
+
## fft
|
|
164
|
+
- [ ] `fft`
|
|
165
|
+
- [ ] `fft2`
|
|
166
|
+
- [ ] `fftfreq`
|
|
167
|
+
- [ ] `fftn`
|
|
168
|
+
- [ ] `fftshift`
|
|
169
|
+
- [ ] `hfft`
|
|
170
|
+
- [ ] `ifft`
|
|
171
|
+
- [ ] `ifft2`
|
|
172
|
+
- [ ] `ifftn`
|
|
173
|
+
- [ ] `ifftshift`
|
|
174
|
+
- [ ] `ihfft`
|
|
175
|
+
- [ ] `irfft`
|
|
176
|
+
- [ ] `irfft2`
|
|
177
|
+
- [ ] `irfftn`
|
|
178
|
+
- [ ] `rfft`
|
|
179
|
+
- [ ] `rfft2`
|
|
180
|
+
- [ ] `rfftfreq`
|
|
181
|
+
- [ ] `rfftn`
|
|
182
|
+
|
|
183
|
+
## linalg
|
|
184
|
+
- [ ] `cholesky`
|
|
185
|
+
- [ ] `cond`
|
|
186
|
+
- [ ] `cross`
|
|
187
|
+
- [ ] `det`
|
|
188
|
+
- [ ] `diagonal`
|
|
189
|
+
- [ ] `eig`
|
|
190
|
+
- [ ] `eigh`
|
|
191
|
+
- [ ] `eigvals`
|
|
192
|
+
- [ ] `eigvalsh`
|
|
193
|
+
- [ ] `inv`
|
|
194
|
+
- [ ] `lstsq`
|
|
195
|
+
- [ ] `matmul`
|
|
196
|
+
- [ ] `matrix_norm`
|
|
197
|
+
- [ ] `matrix_power`
|
|
198
|
+
- [ ] `matrix_rank`
|
|
199
|
+
- [ ] `matrix_transpose`
|
|
200
|
+
- [ ] `norm`
|
|
201
|
+
- [ ] `outer`
|
|
202
|
+
- [ ] `pinv`
|
|
203
|
+
- [ ] `qr`
|
|
204
|
+
- [ ] `slogdet`
|
|
205
|
+
- [ ] `solve`
|
|
206
|
+
- [ ] `svd`
|
|
207
|
+
- [ ] `svdvals`
|
|
208
|
+
- [ ] `tensordot`
|
|
209
|
+
- [ ] `tensorinv`
|
|
210
|
+
- [ ] `tensorsolve`
|
|
211
|
+
- [ ] `trace`
|
|
212
|
+
- [ ] `vdot`
|
|
213
|
+
- [ ] `vecdot`
|
|
214
|
+
- [ ] `vecmat`
|
|
215
|
+
- [ ] `vector_norm`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: haliax
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.dev407
|
|
4
4
|
Summary: Named Tensors for Legible Deep Learning in JAX
|
|
5
5
|
Project-URL: Homepage, https://github.com/stanford-crfm/haliax
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/stanford-crfm/haliax/issues/
|
|
@@ -259,6 +259,9 @@ These are all more or less directly from JAX's NumPy API.
|
|
|
259
259
|
::: haliax.bincount
|
|
260
260
|
::: haliax.clip
|
|
261
261
|
::: haliax.isclose
|
|
262
|
+
::: haliax.allclose
|
|
263
|
+
::: haliax.array_equal
|
|
264
|
+
::: haliax.array_equiv
|
|
262
265
|
::: haliax.pad
|
|
263
266
|
::: haliax.searchsorted
|
|
264
267
|
::: haliax.top_k
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.4.dev407"
|
|
@@ -69,6 +69,9 @@ from .hof import fold, map, scan, vmap
|
|
|
69
69
|
from .jax_utils import tree_checkpoint_name
|
|
70
70
|
from .ops import (
|
|
71
71
|
clip,
|
|
72
|
+
allclose,
|
|
73
|
+
array_equal,
|
|
74
|
+
array_equiv,
|
|
72
75
|
isclose,
|
|
73
76
|
pad_left,
|
|
74
77
|
pad,
|
|
@@ -1105,6 +1108,9 @@ __all__ = [
|
|
|
1105
1108
|
"shard",
|
|
1106
1109
|
"enable_shape_checks",
|
|
1107
1110
|
"are_shape_checks_enabled",
|
|
1111
|
+
"allclose",
|
|
1112
|
+
"array_equal",
|
|
1113
|
+
"array_equiv",
|
|
1108
1114
|
"isclose",
|
|
1109
1115
|
"pad_left",
|
|
1110
1116
|
"pad",
|
|
@@ -138,6 +138,29 @@ def isclose(a: NamedArray, b: NamedArray, rtol=1e-05, atol=1e-08, equal_nan=Fals
|
|
|
138
138
|
return NamedArray(jnp.isclose(a.array, b.array, rtol=rtol, atol=atol, equal_nan=equal_nan), a.axes)
|
|
139
139
|
|
|
140
140
|
|
|
141
|
+
def allclose(a: NamedArray, b: NamedArray, rtol=1e-05, atol=1e-08, equal_nan=False) -> bool:
|
|
142
|
+
"""Returns True if two arrays are element-wise equal within a tolerance."""
|
|
143
|
+
a, b = broadcast_arrays(a, b)
|
|
144
|
+
return bool(jnp.allclose(a.array, b.array, rtol=rtol, atol=atol, equal_nan=equal_nan))
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def array_equal(a: NamedArray, b: NamedArray) -> bool:
|
|
148
|
+
"""Returns True if two arrays have the same shape and elements."""
|
|
149
|
+
if set(a.axes) != set(b.axes):
|
|
150
|
+
return False
|
|
151
|
+
b = b.rearrange(a.axes)
|
|
152
|
+
return bool(jnp.array_equal(a.array, b.array))
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def array_equiv(a: NamedArray, b: NamedArray) -> bool:
|
|
156
|
+
"""Returns True if two arrays are shape-consistent and equal."""
|
|
157
|
+
try:
|
|
158
|
+
a, b = broadcast_arrays(a, b)
|
|
159
|
+
except ValueError:
|
|
160
|
+
return False
|
|
161
|
+
return bool(jnp.array_equal(a.array, b.array))
|
|
162
|
+
|
|
163
|
+
|
|
141
164
|
def pad_left(array: NamedArray, axis: Axis, new_axis: Axis, value=0) -> NamedArray:
|
|
142
165
|
"""Pad an array along named axes."""
|
|
143
166
|
amount_to_pad_to = new_axis.size - axis.size
|
|
@@ -425,6 +425,32 @@ def test_bincount():
|
|
|
425
425
|
assert jnp.allclose(out_w.array, expected_w)
|
|
426
426
|
|
|
427
427
|
|
|
428
|
+
def test_allclose_array_equal_equiv():
|
|
429
|
+
A = Axis("A", 2)
|
|
430
|
+
B = Axis("B", 3)
|
|
431
|
+
x = hax.random.uniform(PRNGKey(0), (A, B))
|
|
432
|
+
y = x + 1e-6
|
|
433
|
+
|
|
434
|
+
assert hax.allclose(x, y)
|
|
435
|
+
assert not hax.allclose(x, x + 1.0)
|
|
436
|
+
|
|
437
|
+
x1 = hax.ones((A, B))
|
|
438
|
+
y_reordered = x1.rearrange((B, A))
|
|
439
|
+
assert hax.array_equal(x1, y_reordered)
|
|
440
|
+
|
|
441
|
+
scalar = hax.ones(())
|
|
442
|
+
assert hax.array_equiv(x1, scalar)
|
|
443
|
+
assert not hax.array_equal(x1, scalar)
|
|
444
|
+
|
|
445
|
+
y_vec = hax.ones((B,))
|
|
446
|
+
assert hax.array_equiv(x1, y_vec)
|
|
447
|
+
assert not hax.array_equal(x1, y_vec)
|
|
448
|
+
|
|
449
|
+
C = Axis("C", 4)
|
|
450
|
+
z = hax.ones((C,))
|
|
451
|
+
assert not hax.array_equiv(x1, z)
|
|
452
|
+
|
|
453
|
+
|
|
428
454
|
def test_roll_scalar_named_shift():
|
|
429
455
|
H = Axis("H", 4)
|
|
430
456
|
W = Axis("W", 3)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.4.dev405"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|