Skip to content

Commit 1d31093

Browse files
committed
[Fix] preprocess_for_tmac: make array contiguous for np.view (#63)
1 parent abc5b84 commit 1d31093

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/t_mac/model_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,4 @@ def preprocess_for_t_mac(
246246
raise KeyError("GEMM of shape ({}, {}) is not found in {}. Please compile the kernels using T-MAC first.".format(M, K, kcfg_file))
247247

248248
w, scales = preprocess_weights(w, scales, zeros, bits=bits, g=g, bm=bm, kfactor=kfactor, simd_n_in=simd_n_in, simd_n_out=simd_n_out)
249-
return np.concatenate([w.flatten(), scales.astype(np.float32).view(np.uint8).flatten()])
249+
return np.concatenate([w.flatten(), scales.astype(np.float32).copy().view(np.uint8).flatten()])

0 commit comments

Comments
 (0)