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

Method _emit_prim

devtools/bundled_program/core.py:186–194  ·  view source on GitHub ↗
(self, val: ConfigValue, bundled_values: List[bp_schema.Value])

Source from the content-addressed store, hash-verified

184 )
185
186 def _emit_prim(self, val: ConfigValue, bundled_values: List[bp_schema.Value]):
187 if type(val) is int:
188 bundled_values.append(bp_schema.Value(val=bp_schema.Int(int_val=val)))
189 elif type(val) is bool:
190 bundled_values.append(bp_schema.Value(val=bp_schema.Bool(bool_val=val)))
191 elif type(val) is float:
192 bundled_values.append(bp_schema.Value(val=bp_schema.Double(double_val=val)))
193 else:
194 assert 0, "Unsupported primitive type received."
195
196 def _get_program_input(
197 self, program: core_schema.Program, plan_idx: int, input_idx: int

Callers 1

serialize_to_schemaMethod · 0.95

Calls 2

ValueMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected