python - How to use PyFFTW's wisom -
i didn't see actual example on pyfftw's documentation of how use 'wisdom' feature i'm little confused.
my code looks following:
# first fft input = pyfftw.zeros_aligned(arraysize, dtype='complex64') input[:] = image fftwobj = pyfftw.builders.fft2(input, planner_effort='fftw_exhaustive') imagefft = fftwobj(input) wisdom = pyfftw.export_wisdom() pyfftw.import_wisdom(wisdom) # second fft same input size different input input = pyfftw.zeros_aligned(arraysize, dtype='complex64') input[:] = image2 fftwobj = pyfftw.builders.fft2(input, planner_effort='fftw_exhaustive') imagefft2 = fftwobj(input)
the docs export_wisdom
outputs tuple of strings , import_wisdom
takes in tuple argument.
when supposed export wisdom , supposed save tuple out file each fft?
when load in? before call each fft?
basically, exporting , importing wisdom method maintain state between sessions.
the wisdom knowledge how best plan fft. during session, internal "wisdom" made of plans made, , wisdom has been imported. repeatedly importing same wisdom file not useful because knowledge known after first import.
you export wisdom when want knowledge particular transform plan used instead of having work out again. need plan transform once per session though.
Comments
Post a Comment