From: Sasha <nd...@ma...> - 2006-07-03 20:23:40
|
On 7/3/06, Sven Schreiber <sve...@gm...> wrote: > ... > I was arguing that it's inconvenient exactly because it's inconsistent, > so I don't see the tradeoff here. (Given that I'm fairly indifferent > between one or two pairs of parentheses.) > It is convenient to be able to write zeros(5) and rand(5,5) instead of consistent zeros([5]) and rand([5,5]). Note that inconsistency will not be fully cured by allowing rand([5,5]) because rand([5,5], float32) will still not work. Actually, I can see some value in a random numbers generator that conforms to the ones/zeros interface because that may promote use of random data in testing instead of ones/zeros. How about rands(shape, dtype=float, low=default_low(dtype), high=default_high(dtype)) ? Where default_{low,high}(floatN) should probably be {0,1} but for integer types some other default may make more sense. |