def numba_mat_count_uniques(mat, ncols): n_uniques = [] for c in range(ncols): q = np.zeros(256, dtype=int) n_unique = numba_unique(mat[:, c], q) n_uniques.append(n_unique) return n_uniques
def numba_mat_count_uniques_bs(mat, n_uniques): B, T, S = mat.shape for b in range(B): for s in range(S): q = np.zeros(256, dtype=int) n_unique = numba_unique(mat[b, :, s], q) n_uniques[b, s] = n_unique