torch_concepts.annotations.Concept¶
- class Concept(name: str, index: int, cardinality: int, type: str, states: ~typing.List[str] | None, slice: slice, metadata: dict = <factory>)[source]¶
Read-only, per-concept view over a single column of an
Annotations.Groups one concept’s properties into a single named object so callers can write
annotations.concept('color').cardinalityinstead of the index-danceint(annotations.cardinalities[annotations.get_index('color')]). It is a view: the values are read from the owningAnnotations’ parallel lists at construction time (no duplicated storage), so the lists remain the canonical representation.- __init__(name: str, index: int, cardinality: int, type: str, states: ~typing.List[str] | None, slice: slice, metadata: dict = <factory>) None¶
Methods
__init__(name, index, cardinality, type, ...)Attributes