View source on GitHub |
Returns a numpy array with all 0s and a single non-zero entry(default 1).
cirq.one_hot(
*,
index: Union[None, int, Sequence[int]] = None,
shape: Union[int, Sequence[int]],
value: Any = 1,
dtype: 'DTypeLike'
) -> np.ndarray
Returns | |
---|---|
The created numpy array. |