Rate this Page

torch.fx.passes.pass_manager.these_before_those_pass_constraint#

torch.fx.passes.pass_manager.these_before_those_pass_constraint(these, those)[source]#

Defines a partial order (‘depends on’ function) where these must occur before those. Where the inputs are ‘unwrapped’ before comparison.

For example, the following pass list and constraint list would be invalid:

passes = [
    loop_pass(pass_b, 3),
    loop_pass(pass_a, 5),
]

constraints = [these_before_those_pass_constraint(pass_a, pass_b)]
Parameters:
  • these (Callable) – pass which should occur first

  • those (Callable) – pass which should occur later

Returns:

depends_on (Callable[[Object, Object], bool])

Return type:

Callable[[Callable[[…], Any], Callable[[…], Any]], bool]