"vscode:/vscode.git/clone" did not exist on "6b800aa7b70379d5b024fdf9cb868d45ae85d14d"
_deprecated.py 739 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
11
12
def to_tensor(inpt: Any) -> torch.Tensor:
    warnings.warn(
        "The function `to_tensor(...)` is deprecated and will be removed in a future release. "
13
        "Instead, please use `to_image(...)` followed by `to_dtype(..., dtype=torch.float32, scale=True)`."
14
15
    )
    return _F.to_tensor(inpt)
16
17


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