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

Method pattern

exir/tests/test_passes.py:1176–1179  ·  view source on GitHub ↗
(x: torch.Tensor, y: torch.Tensor)

Source from the content-addressed store, hash-verified

1174 # decorator registers this pattern as a CompositeExplicitAutograd kernel, since there's no kernel registered before.
1175 @bind_pattern_to_op(lib, "add_relu")
1176 def pattern(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
1177 z = torch.ops.aten.add.Tensor(x, y)
1178 out = torch.ops.aten.relu.default(z)
1179 return out
1180
1181 def replacement(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
1182 return ops.backend.DO_NOT_USE_TEST_ONLY.add_relu.default(x, y)

Callers

nothing calls this directly

Calls 2

TensorMethod · 0.80
defaultMethod · 0.45

Tested by

no test coverage detected