Shortcuts

torch.operator

unsupported_operator

Note

Tags: torch.operator

Support Level: NOT_SUPPORTED_YET

Original source code:

# mypy: allow-untyped-defs
import torch
from torch._export.db.case import SupportLevel


class TorchSymMin(torch.nn.Module):
    """
    torch.sym_min operator is not supported in export.
    """

    def forward(self, x):
        return x.sum() + torch.sym_min(x.size(0), 100)


example_args = (torch.randn(3, 2),)
tags = {"torch.operator"}
support_level = SupportLevel.NOT_SUPPORTED_YET
model = TorchSymMin()


torch.export.export(model, example_args)

Result:

Unsupported: torch.* op returned non-Tensor int call_function <function sym_min at 0x7f98c3497040>

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources