MCPcopy Create free account
hub / github.com/pytorch/tutorials / run

Method run

intermediate_source/fx_profiling_tutorial.py:124–134  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

122 # model.
123
124 def run(self, *args) -> Any:
125 # Record the time we started running the model
126 t_start = time.time()
127 # Run the model by delegating back into Interpreter.run()
128 return_val = super().run(*args)
129 # Record the time we finished running the model
130 t_end = time.time()
131 # Store the total elapsed time this model execution took in the
132 # ``ProfilingInterpreter``
133 self.total_runtime_sec.append(t_end - t_start)
134 return return_val
135
136 ######################################################################
137 # Now, let's override ``run_node``. ``Interpreter`` calls ``run_node`` each

Calls

no outgoing calls

Tested by

no test coverage detected