Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
m-albert committed Oct 8, 2020
1 parent fe4e47b commit f67e6c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mvregfus/multiview.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ def affine_transform_dask(
):

try:
from cupy import asarray
from cupy import asarray, asnumpy
import cupyx.scipy.ndimage as curr_ndimage
gpu = True
print('GPU acceleration for transformation')
Expand Down Expand Up @@ -1717,6 +1717,9 @@ def transform_chunk(x, matrix, offset, input, kwargs, block_info=None):

input_relevant = input[input_relevant_slice]

if not np.min(input_relevant.shape):
return np.zeros(x.shape, dtype=x.dtype)

# print('input_relevant_slice', input_relevant_slice)

# modify offset due to cropped input
Expand Down Expand Up @@ -1746,7 +1749,7 @@ def transform_chunk(x, matrix, offset, input, kwargs, block_info=None):
# **kwargs)

if gpu:
transformed_chunk = cp.asnumpy(transformed_chunk)
transformed_chunk = asnumpy(transformed_chunk)

return transformed_chunk

Expand Down

0 comments on commit f67e6c0

Please sign in to comment.