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

Function _convert_instruction

exir/_serialize/_flatbuffer_program.py:151–163  ·  view source on GitHub ↗
(val: Instruction)

Source from the content-addressed store, hash-verified

149
150
151def _convert_instruction(val: Instruction) -> Any:
152 result = _flatbuffer_t_class(Instruction)()
153 union_val = val.instr_args
154 if union_val is None:
155 result.instrArgsType = _InstructionArguments.InstructionArguments.NONE
156 result.instrArgs = None
157 return result
158 union_name = type(union_val).__name__
159 result.instrArgsType = getattr(
160 _InstructionArguments.InstructionArguments, union_name
161 )
162 result.instrArgs = _convert_value(union_val)
163 return result
164
165
166def _convert_dataclass(val: Any) -> Any:

Callers 1

_convert_valueFunction · 0.85

Calls 2

_flatbuffer_t_classFunction · 0.85
_convert_valueFunction · 0.85

Tested by

no test coverage detected