ytm._core.backends.buffers.PackedClauses#

class ytm._core.backends.buffers.PackedClauses#

Bases: AutoPtrs

Clauses in compact form for evaluation.

Attributes:
clause_feat_idsarray of shape (total_clauses, n_raw_patch_feats)

Features each clause constrains. Only the first clause_n_feats entries are used. Shape (1,) on CPU with all binary features.

clause_feat_boundsarray of shape (total_clauses, n_raw_patch_feats, 2)

Closed range [lower, upper] allowed for each of those features, parallel to clause_feat_ids. Shape (1,) on CPU with all binary features.

clause_n_featsarray of shape (total_clauses,)

Number of used entries in the two arrays above. Shape (1,) on CPU with all binary features.

clause_position_boundsarray of shape (total_clauses, 4)

Closed patch range [min_y, max_y, min_x, max_x] the clause can match. Shape (1, 1) with one patch.

has_contraarray of shape (total_clauses,)

1 when the clause includes a contradiction and can never fire.

clause_lenarray of shape (total_clauses,)

Number of included literals. 0 means the clause is empty.

is_clause_syncedarray of shape (total_clauses,)

0 when the clause changed since it was last packed and needs repacking.

clause_pos_bitsarray of shape (total_clauses, n_bin_feat_chunks)

CPU with all binary features only: bit fid set when the clause includes feature fid. Shape (1,) otherwise.

clause_neg_bitsarray of shape (total_clauses, n_bin_feat_chunks)

CPU with all binary features only: bit fid set when the clause includes the negation of feature fid. Shape (1,) otherwise.