rustify-ml 0.1.2

Profile Python hotspots and auto-generate Rust + PyO3 stubs via maturin
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
�

^Ǖi��	��SrSrSr\S:XGa*SSKrSr\"\\-5Vs/sHn\"US-5PM snr\"\\-5Vs/sHn\"US-5PM snr	\R"5r
\"S	5H
r\"\\	\5 M \R"5\
-
r\
"S
\S\S\S
S35 \"S5Vs/sHn\"U5PM
 snr\"S5Vs/sHn\"U5PM
 snr\R"5r
\"S5Hr\"\\5 M \R"5\
-
r\
"S\S
S35 ggs snfs snfs snfs snf)zv
Pure Python matrix multiply - target for rustify-ml acceleration.
Expected gain: 50-100x via ndarray matmul in Rust.
c���S/X"--n[U5HIn[U5H7nSn[U5HnX`XB-U-XU-U---
nM XcXB-U-'M9 MK U$)u?Multiply two n×n matrices stored as flat Vec<f64> (row-major).�)�range)�a�b�n�result�i�j�total�ks        �=d:\WindsurfProjects\rustify\rustify-ml\examples\matrix_ops.py�matmulrst���U�a�e�_�F�
�1�X���q��A��E��1�X���1�5�1�9���a�%�!�)��4�4��� %�1�5�1�9��	���M�c�X�Sn[[U55HnX UX--
nM U$)z0Compute dot product of two equal-length vectors.r)r�len)rrrr	s    r
�dot_productrs0���E�
�3�q�6�]��
�1���������Lr�__main__�N� ����zmatmul �xz: z.3fzs for 200 iterationsi�i'zdot_product len=1000: zs for 10000 iterations)�__doc__rr�__name__�timerr�floatrr�start�_�elapsed�print�va�vb)r	s0r
�<module>r$sW���	���z���
�A�$�Q��U�|�,�|�!��q�1�u��|�,�A�$�Q��U�|�,�|�!��q�1�u��|�,�A��I�I�K�E�
�3�Z���q�!�Q����i�i�k�E�!�G�	�G�A�3�a��s�"�W�S�M�)=�
>�?�!�$�K�	(�K�q�%��(�K�	(�B�!�$�K�	(�K�q�%��(�K�	(�B��I�I�K�E�
�5�\���B�����i�i�k�E�!�G�	�"�7�3�-�/E�
F�G�%��	-��,��
)��	(s�D;�E�;E�E