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

Function custom_op

intermediate_source/torch_export_tutorial.py:798–800  ·  view source on GitHub ↗
(x: torch.Tensor)

Source from the content-addressed store, hash-verified

796
797@torch.library.custom_op("my_custom_library::custom_op", mutates_args={})
798def custom_op(x: torch.Tensor) -> torch.Tensor:
799 print("custom_op called!")
800 return torch.relu(x)
801
802@custom_op.register_fake
803def custom_op_meta(x):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected