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

Method create

exir/serde/union.py:45–49  ·  view source on GitHub ↗
(cls, **kwargs)

Source from the content-addressed store, hash-verified

43
44 @classmethod
45 def create(cls, **kwargs):
46 assert len(kwargs) == 1
47 obj = cls(**{**{f.name: None for f in fields(cls)}, **kwargs}) # type: ignore[arg-type]
48 obj._type = _UnionTag.create(next(iter(kwargs.keys())), cls)
49 return obj
50
51 def __post_init__(self):
52 assert not any(f.name in ("type", "_type", "create", "value") for f in fields(self)) # type: ignore[arg-type, misc]

Callers 15

serialize_sym_intFunction · 0.45
serialize_sym_boolFunction · 0.45
handle_placeholderMethod · 0.45
handle_call_functionMethod · 0.45
serialize_inputMethod · 0.45
serialize_input_specMethod · 0.45
serialize_output_specMethod · 0.45
serialize_outputsMethod · 0.45

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected