[export] Add missing builtin ops. (#113982)
Summary: Fixing issue https://github.com/pytorch/pytorch/issues/113778
Test Plan: eyes.
Differential Revision: D51436177
Pull Request resolved: https://github.com/pytorch/pytorch/pull/113982
Approved by: https://github.com/Skylion007, https://github.com/ydwu4
diff --git a/torch/_export/verifier.py b/torch/_export/verifier.py
index dc7422b..dae1037 100644
--- a/torch/_export/verifier.py
+++ b/torch/_export/verifier.py
@@ -1,4 +1,5 @@
import inspect
+import math
import operator
from collections.abc import Iterable
from typing import Any, Dict, final, List, Optional, Tuple, Type
@@ -6,13 +7,13 @@
import torch
from torch._ops import HigherOrderOperator, OpOverload
from torch._subclasses.fake_tensor import FakeTensor
+from torch.export.exported_program import ExportedProgram
from torch.export.graph_signature import (
ExportGraphSignature,
InputKind,
SymIntArgument,
TensorArgument,
)
-from torch.export.exported_program import ExportedProgram
from torch.fx import GraphModule
from torch.fx.experimental.symbolic_shapes import SymBool, SymFloat, SymInt
@@ -101,6 +102,11 @@
operator.and_,
operator.or_,
operator.not_,
+ operator.pow,
+ operator.neg,
+ operator.abs,
+ math.ceil,
+ math.floor,
]
def allowed_op_types(self) -> Tuple[Type[Any], ...]: