Skip to content
Snippets Groups Projects
Commit ee3100a1 authored by Matthias Diener's avatar Matthias Diener Committed by Andreas Klöckner
Browse files

Numpy actx: add zeros_like, reshape

parent cb784322
No related branches found
No related tags found
No related merge requests found
...@@ -146,4 +146,13 @@ class NumpyFakeNumpyNamespace(BaseFakeNumpyNamespace): ...@@ -146,4 +146,13 @@ class NumpyFakeNumpyNamespace(BaseFakeNumpyNamespace):
def linspace(self, *args, **kwargs): def linspace(self, *args, **kwargs):
return np.linspace(*args, **kwargs) return np.linspace(*args, **kwargs)
def zeros_like(self, ary):
return rec_map_array_container(np.zeros_like, ary)
def reshape(self, a, newshape, order="C"):
return rec_map_array_container(
lambda ary: ary.reshape(newshape, order=order),
a)
# vim: fdm=marker # vim: fdm=marker
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment