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

Function get_executorch_model

examples/apple/mps/scripts/bench_utils.py:50–61  ·  view source on GitHub ↗
(executorch_program: ExportedProgram)

Source from the content-addressed store, hash-verified

48
49
50def get_executorch_model(executorch_program: ExportedProgram):
51 try:
52 from executorch.extension.pybindings.portable_lib import ( # @manual
53 _load_for_executorch_from_buffer,
54 )
55
56 return _load_for_executorch_from_buffer(executorch_program.buffer)
57 except ImportError:
58 logging.info(
59 "ExecuTorch MPS delegate was built without pybind support (not possible to run forward pass within python)"
60 )
61 return None
62
63
64def bench_torch(executorch_program: ExportedProgram, model, inputs, model_name):

Callers 2

bench_torchFunction · 0.85
compare_outputsFunction · 0.85

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected