Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pietorch/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def blend(target: Tensor, source: Tensor, mask: Tensor, corner_coord: Tensor, mi
else:
assert green_function.shape[d] == 1, f'Green function should have size 1 in non-chosen dimension ' \
f'{d}: has {green_function.shape[d]}.'

if laplacian.device != green_function.device:
green_function = green_function.to(laplacian.device)
# Apply green function convolution
init_blended = torch.fft.ifftn(torch.fft.fftn(laplacian, dim=chosen_dimensions) * green_function,
dim=chosen_dimensions)
Expand Down