(module, dtype)
De-quantizes module to given data type (inplace).

    :param module: PyTorch module.
    :type module: `torch.nn.Module`
    :param dtype: Target data type.
De-quantizes module to given data type (inplace).
De - quantizes module to given data type ( inplace ) .
def dequantize(module, dtype):
    """
    De-quantizes module to given data type (inplace).

    :param module: PyTorch module.
    :type module: `torch.nn.Module`
    :param dtype: Target data type.
    """
    if dtype.as_dtype_enum == dtypes.DT_FLOAT32:
        module.float()
    elif dtype.as_dtype_enum == dtypes.DT_FLOAT64:
        module.double()
    else:
        raise TypeError('Unknown data type specified for de-quantization')
def dequantize ( module , dtype ) : if dtype . as_dtype_enum == dtypes . DT_FLOAT32 : module . float ( ) elif dtype . as_dtype_enum == dtypes . DT_FLOAT64 : module . double ( ) else : raise TypeError ( 'Unknown data type specified for de-quantization' )