MCPcopy Create free account
hub / github.com/pytorch/tutorials / forward

Method forward

intermediate_source/torch_export_tutorial.py:811–815  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

809
810class CustomOpExample(torch.nn.Module):
811 def forward(self, x):
812 x = torch.sin(x)
813 x = torch.ops.my_custom_library.custom_op(x)
814 x = torch.cos(x)
815 return x
816
817exported_custom_op_example = export(CustomOpExample(), (torch.randn(3, 3),))
818print(exported_custom_op_example)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected