Rate this Page

torch.fx.experimental.merge_matmul.may_depend_on#

torch.fx.experimental.merge_matmul.may_depend_on(a, b, search_depth=6)[source]#

Determine if one node depends on another in a torch.fx.Graph.

Parameters:
  • a (Node) – The node that may have a dependency on b.

  • b (Node) – The node that a may have a dependency on.

  • search_depth (int) – In the case of an indirect dependency, this function searches upto this many nodes away in search of a data dependency. If none is found, the function makes the conservative assumption that there is a dependency.

Returns:

True if a may depend on b, False if it definitely does not.