Skip to content

An experimental neural network quantization environment in Pytorch.

License

Notifications You must be signed in to change notification settings

neolinsu/pytorch_quant_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytorch_quant_tool

An experimental neural network quantization environment in Pytorch.

Post Training Quantization

  • NOTE: Fuse the well-trained model before operating Post Training Quantization.

fuse_model(model, rules, inplace=True):

Fuse the model with a list of rules.

  • Args:
    • model: A nn.Module to be fused.
    • rules: A list of rule object functions as FuseRule.
    • inplace: Bool. If True, the model object will be modified.
  • Return:
    • A new fused model, if inplace is False.

post_training_quant

Quant a trained model (int8).

  • Args:
    • model: A fused nn.Module to be quanted.
    • data_loader: A data loader provides input data iterations.
    • batches: The limitation of iteration(batch) number. *inplace: Bool. If True, the model object will be modified.
  • Return: A new quanted model, if inplace is False.

About

An experimental neural network quantization environment in Pytorch.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages