MCPcopy Create free account
hub / github.com/pytorch/pytorch / module

Method module

torch/export/exported_program.py:349–359  ·  view source on GitHub ↗

Returns a self contained GraphModule with all the parameters/buffers inlined.

(self, *, flat: bool = True)

Source from the content-addressed store, hash-verified

347 return string
348
349 def module(self, *, flat: bool = True) -> torch.nn.Module:
350 """
351 Returns a self contained GraphModule with all the parameters/buffers inlined.
352 """
353 from torch._export.unflatten import unflatten
354 from ._unlift import _unlift_exported_program_lifted_states
355
356 if flat:
357 return _unlift_exported_program_lifted_states(self)
358 else:
359 return unflatten(self)
360
361 @_disable_prexisiting_fake_mode
362 def run_decompositions(

Callers 15

forwardMethod · 0.45
upgradeMethod · 0.45
forwardMethod · 0.45
__call__Method · 0.45
__getstate__Method · 0.45
_run_ddp_forwardMethod · 0.45
forwardMethod · 0.45
applyMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45

Calls 2

unflattenFunction · 0.90

Tested by 15

forwardMethod · 0.36
forwardMethod · 0.36
forwardMethod · 0.36
forwardMethod · 0.36
forwardMethod · 0.36
test_save_loadMethod · 0.36
test_tp_transform_e2eMethod · 0.36
forwardMethod · 0.36
forwardMethod · 0.36