[Numpy-discussion] switching to float32
dg.gmane at thesamovar.net
Sat Jun 27 06:58:16 EDT 2009
Robert Kern wrote:
> On Fri, Jun 26, 2009 at 03:39, Christian K.<ckkart at hoc.net> wrote:
>> John Schulman <joschu <at> caltech.edu> writes:
>>> I'm trying to reduce the memory used in a calculation, so I'd like to
>>> switch my program to float32 instead of float64. Is it possible to
>>> change the numpy default float size, so I don't have to explicitly
>>> state dtype=np.float32 everywhere?
>> Possibly not the nicest way, but
>> np.float64 = np.float32
>> somewhere at the beginning should work.
> No. There is no way to change the default dtype of ones(), zeros(), etc.
Is there any chance that this will ever be changed or is it considered
too unpythonic / too much work to implement? I would find this quite a
useful feature in a project I'm working on, because I want to mixing
some GPU code in to various places with pycuda, but older GPU cards only
have support for float32.
More information about the NumPy-Discussion