dtype and scale the values accordinglyR/transforms-generics.R
transform_convert_image_dtype.RdConvert a tensor image to the given dtype and scale the values accordingly
transform_convert_image_dtype(img, dtype = torch::torch_float())When converting from a smaller to a larger integer dtype the maximum
values are not mapped exactly. If converted back and forth, this
mismatch has no effect.
Other unitary_transforms:
transform_adjust_brightness(),
transform_adjust_contrast(),
transform_adjust_gamma(),
transform_adjust_hue(),
transform_adjust_saturation(),
transform_affine(),
transform_center_crop(),
transform_crop(),
transform_grayscale(),
transform_hflip(),
transform_linear_transformation(),
transform_normalize(),
transform_pad(),
transform_perspective(),
transform_resize(),
transform_rgb_to_grayscale(),
transform_rotate(),
transform_to_tensor(),
transform_vflip()