Skip to content

Commit b0f9f7b

Browse files
authored
Use compiler.is_compiling() instead of deprecated _dynamo.is_compiling() (#8455)
1 parent 9b4b742 commit b0f9f7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/transforms/v2/functional/_geometry.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def resize(
194194
# according to our benchmarks on eager, non-AVX CPUs should still prefer u8->f32->interpolate->u8 path for bilinear
195195
def _do_native_uint8_resize_on_cpu(interpolation: InterpolationMode) -> bool:
196196
if interpolation == InterpolationMode.BILINEAR:
197-
if torch._dynamo.is_compiling():
197+
if torch.compiler.is_compiling():
198198
return True
199199
else:
200200
return "AVX2" in torch.backends.cpu.get_cpu_capability()
@@ -525,7 +525,7 @@ def _get_inverse_affine_matrix(
525525

526526

527527
def _compute_affine_output_size(matrix: List[float], w: int, h: int) -> Tuple[int, int]:
528-
if torch._dynamo.is_compiling() and not torch.jit.is_scripting():
528+
if torch.compiler.is_compiling() and not torch.jit.is_scripting():
529529
return _compute_affine_output_size_python(matrix, w, h)
530530
else:
531531
return _compute_affine_output_size_tensor(matrix, w, h)

0 commit comments

Comments
 (0)