one_hot¶

one_hot(poly: Poly, label: str = '') Constraint¶
one_hot(array: PolyArray, label: str = '', axis: Literal[None] | None = None) Constraint
one_hot(
array: PolyArray,
label: str = '',
axis: int | tuple[int, ...] | None = None,
) Constraint | ConstraintList

one_hot

Overloading:

1. one_hot(poly: amplify.Poly, label: str = '') -> amplify.Constraint

Args:
  • poly (amplify.Poly):

  • label (str): Defaults to ''.

Returns:

amplify.Constraint:

2. one_hot(array: amplify.PolyArray, label: str = '', axis: Optional[Literal[None]] = None) -> amplify.Constraint

Args:
  • array (amplify.PolyArray):

  • label (str): Defaults to ''.

  • axis (Literal[None] | None): Defaults to None.

Returns:

amplify.Constraint:

3. one_hot(array: amplify.PolyArray, label: str = '', axis: Optional[Union[int, tuple[int, ...]]] = None) -> Union[amplify.Constraint, amplify.ConstraintList]

Args:
  • array (amplify.PolyArray):

  • label (str): Defaults to ''.

  • axis (int | tuple[int, ...] | None): Defaults to None.

Returns:

amplify.Constraint | amplify.ConstraintList: