MCPcopy
hub / github.com/pytorch/vision / resized_crop

Function resized_crop

torchvision/transforms/v2/functional/_geometry.py:2662–2697  ·  view source on GitHub ↗

See :class:`~torchvision.transforms.v2.RandomResizedCrop` for details.

(
    inpt: torch.Tensor,
    top: int,
    left: int,
    height: int,
    width: int,
    size: list[int],
    interpolation: Union[InterpolationMode, int] = InterpolationMode.BILINEAR,
    antialias: Optional[bool] = True,
)

Source from the content-addressed store, hash-verified

2660
2661
2662def resized_crop(
2663 inpt: torch.Tensor,
2664 top: int,
2665 left: int,
2666 height: int,
2667 width: int,
2668 size: list[int],
2669 interpolation: Union[InterpolationMode, int] = InterpolationMode.BILINEAR,
2670 antialias: Optional[bool] = True,
2671) -> torch.Tensor:
2672 """See :class:`~torchvision.transforms.v2.RandomResizedCrop` for details."""
2673 if torch.jit.is_scripting():
2674 return resized_crop_image(
2675 inpt,
2676 top=top,
2677 left=left,
2678 height=height,
2679 width=width,
2680 size=size,
2681 interpolation=interpolation,
2682 antialias=antialias,
2683 )
2684
2685 _log_api_usage_once(resized_crop)
2686
2687 kernel = _get_kernel(resized_crop, type(inpt))
2688 return kernel(
2689 inpt,
2690 top=top,
2691 left=left,
2692 height=height,
2693 width=width,
2694 size=size,
2695 interpolation=interpolation,
2696 antialias=antialias,
2697 )
2698
2699
2700@_register_kernel_internal(resized_crop, torch.Tensor)

Callers

nothing calls this directly

Calls 3

_log_api_usage_onceFunction · 0.90
resized_crop_imageFunction · 0.85
_get_kernelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…