Skip to content

Commit

Permalink
replace zeros_like with empty_like
Browse files Browse the repository at this point in the history
  • Loading branch information
zachjweiner committed Oct 31, 2020
1 parent c54a6fb commit 98994c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pystella/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,13 @@ def get_tmp_arrays_like(self, **kwargs):
tmp_name = gen_tmp_name(name)
import pyopencl.array as cla
if isinstance(f, cla.Array):
tmp_arrays[tmp_name] = cla.zeros_like(f)
tmp_arrays[tmp_name] = cla.empty_like(f)
elif isinstance(f, np.ndarray):
tmp_arrays[tmp_name] = np.zeros_like(f)
tmp_arrays[tmp_name] = np.empty_like(f)
else:
raise ValueError(f"Could not generate tmp array for {f}"
f"of type {type(f)}")
tmp_arrays[tmp_name][...] = 0.

return tmp_arrays

Expand Down

0 comments on commit 98994c6

Please sign in to comment.