File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -299,12 +299,10 @@ def __init__(
299299 ):
300300 if all (isinstance (input , PIL .Image .Image ) for input in [actual , expected ]):
301301 actual , expected = (to_image (input ) for input in [actual , expected ])
302- elif CVCUDA_AVAILABLE and all (isinstance (input , _import_cvcuda ().Tensor ) for input in [actual , expected ]):
303- actual , expected = (cvcuda_to_tensor (input ) for input in [actual , expected ])
304- elif CVCUDA_AVAILABLE and isinstance (actual , _import_cvcuda ().Tensor ) and isinstance (expected , PIL .Image .Image ):
305- actual = cvcuda_to_pil_compatible_tensor (actual )
306- expected = to_image (expected )
307- elif CVCUDA_AVAILABLE and isinstance (actual , _import_cvcuda ().Tensor ):
302+
303+ # handle check for CV-CUDA Tensors
304+ if CVCUDA_AVAILABLE and isinstance (actual , _import_cvcuda ().Tensor ):
305+ # Use the PIL compatible tensor, so we can always compare with PIL.Image.Image
308306 actual = cvcuda_to_pil_compatible_tensor (actual )
309307
310308 super ().__init__ (actual , expected , ** other_parameters )
You can’t perform that action at this time.
0 commit comments