We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python<-->python转换需测数据:
c++ <--> python转换需测数据:
The text was updated successfully, but these errors were encountered:
import numpy as np import ctypes length = 16 * 3 * 224 * 224 src_np = np.array(np.random.randn(length), dtype="float32") %timeit dst_list = list(src_np) %timeit dst_list = src_np.tolist() src_ctype = ctypes.c_float * length src_cp = src_ctype() %timeit dst_list = list(src_cp) %timeit dst_list = src_cp[:] src_list = [float(1.0 * i / length) for i in range(length)] %timeit dst_np = np.array(src_list, dtype='float32') %timeit src_cp[:] = src_list %timeit -n 10 dst_cp = src_ctype(*src_list)
比如用ipython的%timeit的来获取性能
Sorry, something went wrong.
10 loops
size 1024 * 1024
type float32
python to python
MRXLT
No branches or pull requests
python<-->python转换需测数据:
c++ <--> python转换需测数据:
The text was updated successfully, but these errors were encountered: