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

Class Foo

fx/profiling_tracer.py:16–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15# Setup: a module with `record_function`
16class Foo(torch.nn.Module):
17 def forward(self, x):
18 with torch.profiler.record_function('foo'):
19 return torch.relu(x)
20
21f = Foo()
22x = torch.randn(5, 3, 2)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected