This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import coremltools | |
from coremltools.models.neural_network.quantization_utils import * | |
def quantize(file, bits, functions): | |
""" | |
Processes a file to quantize it for each bit-per-weight | |
and function listed. | |
file : Core ML file to process (example : mymodel.mlmodel) | |
bits : Array of bit per weight (example : [16,8,6,4,2,1]) |