_deprecated.py 808 Bytes
Newer Older
1
import warnings
2
from typing import Any, List
3

4
import torch
5
6
7
8

from torchvision.transforms import functional as _F


9
@torch.jit.unused
10
def to_tensor(inpt: Any) -> torch.Tensor:
Nicolas Hug's avatar
Nicolas Hug committed
11
    """[BETA] [DEPREACTED] Use to_image() and to_dtype() instead."""
12
13
    warnings.warn(
        "The function `to_tensor(...)` is deprecated and will be removed in a future release. "
14
        "Instead, please use `to_image(...)` followed by `to_dtype(..., dtype=torch.float32, scale=True)`."
15
16
    )
    return _F.to_tensor(inpt)
17
18


19
def get_image_size(inpt: torch.Tensor) -> List[int]:
20
21
    warnings.warn(
        "The function `get_image_size(...)` is deprecated and will be removed in a future release. "
Philip Meier's avatar
Philip Meier committed
22
        "Instead, please use `get_size(...)` which returns `[h, w]` instead of `[w, h]`."
23
24
    )
    return _F.get_image_size(inpt)