Function tch::vision::image::save[][src]

pub fn save<T: AsRef<Path>>(t: &Tensor, path: T) -> Result<(), TchError>

Saves an image to a file.

This expects as input a tensor of shape [channel, height, width]. The image format is based on the filename suffix, supported suffixes are jpg, png, tga, and bmp. The tensor input should be of kind UInt8 with values ranging from 0 to 255.