Function
implement_op
(custom_op, op_name, outputs)
Source from the content-addressed store, hash-verified
| 800 | from pathlib import Path |
| 801 | |
| 802 | def implement_op(custom_op, op_name, outputs): |
| 803 | @torch.library.impl( |
| 804 | custom_op, str(op_name), dispatch_key="CompositeExplicitAutograd" |
| 805 | ) |
| 806 | def op_impl(inputs: List[torch.Tensor]): |
| 807 | return tuple( |
| 808 | torch.zeros(tuple(v.shape), device="meta", dtype=v.dtype) |
| 809 | for v in outputs.values() |
| 810 | ) |
| 811 | |
| 812 | def build_graph( |
| 813 | inputs, |
Tested by
no test coverage detected