sparseml
sparseml copied to clipboard
Allow buffers to set modifier's device
While applying modifiers, we utilize the module's device to set the correct device for the additional modules/buffers like fake quantization modules.
Presently, we default to cpu in case the module doesn't have any parameters. This PR adds the capability to utilize the buffer's device in case there are no parameters in the module. The change is based on PyTorch's latest implementation from which the get_device function is adapted from.