Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jerryzh168/07e296c19306171d1f4676cc7d87d7a5 to your computer and use it in GitHub Desktop.
Save jerryzh168/07e296c19306171d1f4676cc7d87d7a5 to your computer and use it in GitHub Desktop.
import torchvision.models as models
import torch
from torch.quantization.quantize_fx import prepare_fx, convert_fx
rn18 = models.resnet18().eval()
qconfig_dict = {"": torch.quantization.default_qconfig}
rn18 = prepare_fx(rn18, qconfig_dict)
rn18 = convert_fx(rn18, is_reference=True)
print(rn18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment