Skip to content

Commit

Permalink
temporarily use old bad method of creating zeros/ones/full
Browse files Browse the repository at this point in the history
  • Loading branch information
majosm committed May 25, 2023
1 parent b24260d commit 943daed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arraycontext/impl/pytato/fake_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def __getattr__(self, name):

def zeros_like(self, ary):
def _zeros_like(array):
return self._array_context.zeros(
array.shape, array.dtype).copy(axes=array.axes, tags=array.tags)
return 0*array

return self._array_context._rec_map_container(
_zeros_like, ary, default_scalar=0)
Expand All @@ -84,8 +83,7 @@ def ones_like(self, ary):

def full_like(self, ary, fill_value):
def _full_like(subary):
return pt.full(subary.shape, fill_value, subary.dtype).copy(
axes=subary.axes, tags=subary.tags)
return fill_value * (0*ary + 1)

return self._array_context._rec_map_container(
_full_like, ary, default_scalar=fill_value)
Expand Down

0 comments on commit 943daed

Please sign in to comment.