Currently if the user wants to have the fused model while preserving the original, they have to do
import copy
import torchvision.models.quantization as models
model = models.resnet18(pretrained=True, progress=True, quantize=False)
model_fused = copy.deepcopy(model)
model_fused.fuse_model()
Given that the quantization API provides an inplace variant for the torch.quantization.fuse_modules, we need to have an option for inplace in the model methods as well.
Currently if the user wants to have the fused model while preserving the original, they have to do
Given that the quantization API provides an inplace variant for the
torch.quantization.fuse_modules
, we need to have an option for inplace in the model methods as well.