:mod:`blueoil.converter.modules.packer` ======================================= .. py:module:: blueoil.converter.modules.packer .. autoapi-nested-parse:: Packer module. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: blueoil.converter.modules.packer.Packer .. py:class:: Packer(bitwidth: int, wordsize: int) Packer class packs small integer values to dense unsigned integer (uint8 or uint32). .. method:: _pack_to_word(self, v) .. method:: run(self, tensor: np.ndarray, data_format: str = 'NHWC') -> np.ndarray Pack a tensor. :param tensor: Input tensor. :type tensor: np.ndarray :param data_format: Order of dimension. This defaults to 'NHWC', where 'N' is the number of kernels, 'H' and 'W' are the height and width, and 'C' is the number of channels. :type data_format: str :returns: Quantized tensor. :rtype: np.ndarray