The following code seems to be causing the problem:
def _replace_zero_by_x_arrays(sub_arys):
for i in range(len(sub_arys)):
if len(_nx.shape(sub_arys[i])) == 0:
sub_arys[i] = _nx.array([])
elif _nx.sometrue(_nx.equal(_nx.shape(sub_arys[i]),0)):
sub_arys[i] = _nx.array([])
return sub_arys
shouldn't those _nx.array([]) be replaced by _nx.array([], dtype=sub_arys[i].dtype)?
Original ticket http://projects.scipy.org/numpy/ticket/2156 on 2012-06-12 by atmention:fengy-research, assigned to unknown.
The original dtype is u4, but the output becomes f8.
The following code seems to be causing the problem:
shouldn't those _nx.array([]) be replaced by _nx.array([], dtype=sub_arys[i].dtype)?