Merge pull request #1595 from outofculture/cupy-bug-workaround

Workaround for cupy indexing bug
This commit is contained in:
Ogi Moore 2021-02-19 21:58:14 -08:00 committed by GitHub
commit 3eda637652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1238,7 +1238,11 @@ def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False, output=None
# apply nan mask through alpha channel # apply nan mask through alpha channel
if nanMask is not None: if nanMask is not None:
alpha = True alpha = True
imgData[nanMask, 3] = 0 # Workaround for https://github.com/cupy/cupy/issues/4693
if xp == cp:
imgData[nanMask, :, 3] = 0
else:
imgData[nanMask, 3] = 0
profile('alpha channel') profile('alpha channel')
return imgData, alpha return imgData, alpha