Is there anything similar to PIL’s Image.quantize() 3 in PyTorch?
Quantize reduces the number of colors in an image, with an option to a specific set of target colors. I am sure a similar function could be created for tensors but would the gradient be maintained? If yes, any tips on implementing it in an efficient way?