save_imageΒΆ
- torchvision.utils.save_image(tensor: Union[Tensor, list[torch.Tensor]], fp: Union[str, Path, BinaryIO], format: Optional[str] = None, **kwargs) None [source]ΒΆ
Save a given Tensor into an image file.
- Parameters:
tensor (Tensor or list) β Image to be saved. If given a mini-batch tensor, saves the tensor as a grid of images by calling
make_grid
.fp (string or file object) β A filename or a file object
format (Optional) β If omitted, the format to use is determined from the filename extension. If a file object was used instead of a filename, this parameter should always be used.
**kwargs β Other arguments are documented in
make_grid
.