import numpy as np
from numpy.core.multiarray import zeros


def generate_fake_tensor_info(node):
    qmin, qmax, zero = None, None, None
    for attr in node.attribute:
        if attr.name == "quant_max":
            qmax = attr.i
        elif attr.name == "quant_min":
            qmin = attr.i
    quant_bit = np.log2(qmax - qmin + 1)
    if quant_bit > 4:
        if qmin < 0:
            data_type = "DT_INT8"
        else:
            data_type = "DT_UINT8"
    else:
        if qmin < 0:
            data_type = "DT_INT4"
        else:
            data_type = "DT_UINT4"

    tensor_info = {
        "quantInfo": {
            "scale": 1.0, # fake quant info for QMNN
            "zero": 0.0, # fake quant info for QMNN
            "min": qmin,
            "max": qmax,
            "type": data_type,
            "realtype": data_type,
            "isdequant": False
        }
    }

    return tensor_info        
        