fullseye

indices_to_labels — REPRCONV index op

使い方

添字 (N,) → 選択マスク labelsindices の出口(可逆)。

max(indices) + 1 長の 1-D ラベル配列を作り、選ばれた位置に 1 を置く。 indices -> labels -> indicesbit 一致(重複と順序を除く)。 逆向き labels -> indices -> labels末尾の背景を落とす (長さが max_index + 1 に切り詰まる)—— これは情報の損失であって バグではないので、:func:labels_to_indices の docstring に量を書いてある。

Args: indices: (N,) の非負整数配列。 Returns: (max + 1,) の int64 ラベル配列(選択 = 1、背景 = 0)。 Raises: ValueError: 1-D でない / 負 / 空 / 上限超。

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(labels を入力に取れる)

labels_to_indices

同カテゴリ(index)

labels_to_indices · select_points


Provenance: reprconv.py — REPRCONV operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.