read_file¶
- torchvision.io.read_file(path: str) Tensor[source]¶
[DEPRECATED] Use TorchCodec instead.
Return the bytes contents of a file as a uint8 1D Tensor.
Warning
The image decoding and encoding capabilities of TorchVision are deprecated since torchvision 0.29 and will be removed in a future release. They are superseded by the more complete decoders and encoders of TorchCodec (from torchcodec 0.16). Please see this migration guide on how to migrate your code.
- Parameters:
path (str or
pathlib.Path) – the path to the file to be read- Returns:
data (Tensor)