ai-content-maker/.venv/Lib/site-packages/torch/jit/_decomposition_utils.py

12 lines
375 B
Python
Raw Permalink Normal View History

2024-05-03 04:18:51 +03:00
import torch
from torch._ops import OpOverload, OpOverloadPacket
def _register_decomposition(op: OpOverload, graph: torch._C.Graph):
assert not isinstance(
op, OpOverloadPacket
), f"Must pass specific op overload, not overload packet, found {op}"
assert isinstance(op, OpOverload)
torch._C._jit_register_decomposition_for_schema(op._schema, graph)