teamtomo / libtilt

Image processing for cryo-electron microscopy in PyTorch
Other
14 stars 5 forks source link

grid flip is slow in central slice grid generation #55

Open alisterburt opened 5 months ago

alisterburt commented 5 months ago

https://github.com/teamtomo/libtilt/blob/958e58096746a00e437f8714eca11815af4a669e/src/libtilt/grids/central_slice_grid.py#L45-L46

@rsanchezgarc pointed out this is really slow as it copies the tensor... negative strides aren't supported so not sure of the best way to deal with this right now, flipping the matrices may be cheaper at the expense of simplicity of implementation...

rsanchezgarc commented 5 months ago

We can leave it as it is with a "#TODO: Investigate how to make it faster". I am sure negative striding is a feature that people demand for pytorch, so eventually, it will be there.

alisterburt commented 5 months ago

For sure, it seems like they might have done some things that make it fundamentally quite difficult though - the issues go back a long way (e.g. pytorch/pytorch#604)