mila-iqia / fuel

A data pipeline framework for machine learning
MIT License
867 stars 268 forks source link

recover numpy.ndarray alignment after transmisson #327

Closed Beronx86 closed 7 years ago

Beronx86 commented 8 years ago

After transformation by start_server and DataServerStream, the numpy.ndarray may become unaligned.

abergeron commented 8 years ago

That will introduce a copy which is bad for performance.

bartvm commented 8 years ago

I guess you could do data = [a if a.flags.aligned else numpy.require(a, requirements='A') for a in data]?

abergeron commented 8 years ago

Or you could use copy=False which avoids the problem entirely.

rizar commented 7 years ago

@bartvm , I checked, it works.