decode_gif¶
- torchvision.io.decode_gif(input: Tensor) Tensor [source]¶
Decode a GIF image into a 3 or 4 dimensional RGB Tensor.
The values of the output tensor are uint8 between 0 and 255. The output tensor has shape
(C, H, W)
if there is only one image in the GIF, and(N, C, H, W)
if there areN
images.- Parameters:
input (Tensor[1]) – a one dimensional contiguous uint8 tensor containing the raw bytes of the GIF image.
- Returns:
output (Tensor[image_channels, image_height, image_width] or Tensor[num_images, image_channels, image_height, image_width])