MCPcopy Create free account
hub / github.com/pytorch/examples / pattern

Function pattern

fx/subgraph_rewriter_basic_use.py:51–53  ·  view source on GitHub ↗
(a1, a2)

Source from the content-addressed store, hash-verified

49# operations that contribute to the single output value of the pattern
50# are considered
51def pattern(a1, a2):
52 val1 = torch.neg(a1)
53 return torch.cat([val1, a2]).sum()
54
55# Define the replacement (same rules as the pattern)
56def replacement(w1, w2):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected