Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

neilisaac / torch   python

Repository URL to install this package:

Version: 1.8.0 

/ quantization / quant_type.py

import enum

# Quantization type (dynamic quantization, static quantization).
# Should match the c++ enum in quantization_type.h
class QuantType(enum.IntEnum):
    DYNAMIC = 0
    STATIC = 1
    QAT = 2
    WEIGHT_ONLY = 3


def quant_type_to_str(quant_type):
    m = {
        QuantType.STATIC: "static",
        QuantType.DYNAMIC: "dynamic",
        QuantType.QAT: "qat",
        QuantType.WEIGHT_ONLY: "weight_only",
    }
    return m[quant_type]