shixian.shi
2023-11-23 c9f1b4e8a2e903f74de20d019e70307c26e93c3e
funasr/utils/misc.py
@@ -12,7 +12,7 @@
    return numel
def int2vec(x, vec_dim=8, dtype=np.int):
def int2vec(x, vec_dim=8, dtype=np.int32):
    b = ('{:0' + str(vec_dim) + 'b}').format(x)
    # little-endian order: lower bit first
    return (np.array(list(b)[::-1]) == '1').astype(dtype)