Numpy NdArray Memoization

情到浓时终转凉″ 提交于 2019-11-28 23:15:21

问题


I'm working on some fairly computational intensive calculations that deal with numpy matrices and ndarrays, and from some digging around, there are about a dozen ways not to implement memoization, generally full of collisions, and issues with ndarrays being mutable objects.

Has anyone come across a fairly general memoisation decorator that can handle numpy objects?


回答1:


How about this package:

http://packages.python.org/joblib/memory.html




回答2:


An alternative is my package jug:

http://packages.python.org/Jug

It is similar to joblib, but with a slightly different approach.



来源:https://stackoverflow.com/questions/5362781/numpy-ndarray-memoization

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!