Hello/.
I’d like to interpolate bool tensor(mask) to fit various target tensor, but I got:
“upsample_nearest2d” not implemented for ‘Bool’.
So this process:
mask(BoolTensor) -> 1.0 and 0.0 only existing tensor(FloatTensor)  -> interpolate(size changed) -> again BoolTensor by doing .to(torch.bool)
is best way to interpolating bool tensor?
Surely I can do above process in manually in CPU mode, but I got stuck on multi-GPU environment.
I implemented above  process like:
assert mask.dtype is torch.bool

# define broadcast-able helper tensors
zeros = torch.zeros(size=mask.shape, dtype=torch.float, device=mask.device)
ones = torch.ones(size=mask.shape, dtype=torch.float, device=mask.device)

mask_in_float = zeros.masked_scatter(mask, ones)

and I got unexpected error:

RuntimeError: cuda runtime error (59) : device-side assert triggered at /opt/conda/conda-bld/pytorch_1579027003190/work/aten/src/THC/THCReduceAll.cuh:327

Even this error occurs in the middle of training, not the first time of this code snippet works. I don’t know why this error happens…
So, my question is…

Is there any more good process or function that interpolating bool tensor?
If my idea is best, how do I avoid error() in multi-GPU environment?

Any suggestion will be appreciated.