MCPcopy Create free account
hub / github.com/pytorch/executorch / _get_io_index

Function _get_io_index

exir/print_program.py:192–199  ·  view source on GitHub ↗

The list is short enough so linear scan is proper.

(iolist: List[int], target_evalue_idx: int)

Source from the content-addressed store, hash-verified

190
191 def _format_arg(evalue_idx: int) -> str:
192 def _get_io_index(iolist: List[int], target_evalue_idx: int) -> int:
193 """
194 The list is short enough so linear scan is proper.
195 """
196 for io_idx, evalue_idx in enumerate(iolist):
197 if evalue_idx == target_evalue_idx:
198 return io_idx
199 return -1
200
201 argstr = str(evalue_idx)
202 if (input_idx := _get_io_index(inputs, evalue_idx)) >= 0:

Callers 1

_format_argFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected