def ref_hist(inp, nbins=64, offset=-48):
    """
    Implement a log2 histogram geared towards visualizing neural net parameters.

    Bins are computed as the log2 of the magnitude of a tensor value.  Bins are
    rounded to the nearest int.

    Smallest value bin extends to -Inf to enable visualization of zeros.

    Log2 computation is always done in fp32 regardless of input dtype to give
    rounding a consistent behavior.
    """
    bins = np.arange(nbins + 1) + float(offset)
    bins[0] = -float('Inf')
    np_inp_log_abs = np.rint(np.log2(np.abs(inp.astype(np.float32))))
    np_hist, edges = np.histogram(np_inp_log_abs, density=False, bins=bins)
    if (np_hist.ndim <= 2):
        np_hist = np_hist.reshape(1, np_hist.size)
    return np_hist
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/tests/test_hist.py/ref_hist/operator `<` -> `<=`