Skip to content

Commit 973e058

Browse files
committed
resolve more review comments
1 parent b21d9f0 commit 973e058

File tree

1 file changed

+2
-6
lines changed
  • torchvision/transforms/v2/functional

1 file changed

+2
-6
lines changed

torchvision/transforms/v2/functional/_misc.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,6 @@ def _to_dtype_tensor_dispatch(inpt: torch.Tensor, dtype: torch.dtype, scale: boo
364364
torch.int64: cvcuda.Type.S64,
365365
torch.float32: cvcuda.Type.F32,
366366
torch.float64: cvcuda.Type.F64,
367-
torch.complex64: cvcuda.Type.C64,
368-
torch.complex128: cvcuda.Type.C128,
369367
}
370368
# create reverse mapping
371369
_cvcuda_to_torch_dtypes = {v: k for k, v in _torch_to_cvcuda_dtypes.items()}
@@ -414,9 +412,7 @@ def _to_dtype_cvcuda(
414412
# 2. int -> int
415413
# 3. float -> int
416414
# 4. int -> float
417-
if in_dtype_float and out_dtype_float:
418-
scale_val, offset = 1.0, 0.0
419-
elif not in_dtype_float and not out_dtype_float:
415+
if in_dtype_float == out_dtype_float:
420416
scale_val, offset = 1.0, 0.0
421417
elif in_dtype_float and not out_dtype_float:
422418
scale_val, offset = float(_max_value(dtype)), 0.0
@@ -432,7 +428,7 @@ def _to_dtype_cvcuda(
432428

433429

434430
if CVCUDA_AVAILABLE:
435-
_to_dtype_cvcuda_registered = _register_kernel_internal(to_dtype, _import_cvcuda().Tensor)(_to_dtype_cvcuda)
431+
_register_kernel_internal(to_dtype, _import_cvcuda().Tensor)(_to_dtype_cvcuda)
436432

437433

438434
def sanitize_bounding_boxes(

0 commit comments

Comments
 (0)