def dtable(self, query):
assert query.dtype == np.float32<EOL>assert query.ndim == <NUM_LIT:1>, "<STR_LIT>"<EOL>D, = query.shape<EOL>assert D == self.Ds * self.M, "<STR_LIT>"<EOL>dtable = np.empty((self.M, self.Ks), dtype=np.float32)<EOL>for m in range(self.M):<EOL><INDENT>query_sub = query[m * self.Ds : (m+<NUM_LIT:1>) * self.Ds]<EOL>dtable[m, :] = np.linalg.norm(self.codewords[m] - query_sub, axis=<NUM_LIT:1>) ** <NUM_LIT:2><EOL><DEDENT>return DistanceTable(dtable)<EOL>
Compute a distance table for a query vector.
        The distances are computed by comparing each sub-vector of the query
        to the codewords for each sub-subspace.
        `dtable[m][ks]` contains the squared Euclidean distance between
        the `m`-th sub-vector of the query and the `ks`-th codeword
        for the `m`-th sub-space (`self.codewords[m][ks]`).

        Args:
            query (np.ndarray): Input vector with shape=(D, ) and dtype=np.float32

        Returns:
            nanopq.DistanceTable:
                Distance table. which contains
                dtable with shape=(M, Ks) and dtype=np.float32