@@ -183,36 +183,27 @@ def __call__(self, *args, **kwargs):
183
183
# FIXME(after #225): Move import to the top of the file.
184
184
from onnxscript import evaluator # pylint: disable=import-outside-toplevel
185
185
186
- schema = self .get_schema ()
186
+ schema = self .opschema
187
187
if schema is None :
188
188
raise RuntimeError (
189
189
f"Op '{ self .opname } ' does not have an OpSchema and cannot be evaluated."
190
190
)
191
191
return evaluator .default ().eval (schema , args , kwargs )
192
192
193
- def is_single_op (self ) -> bool :
194
- return isinstance (self .opname , str )
195
-
196
193
@property
197
194
def opschema (self ) -> Optional [onnx .defs .OpSchema ]:
198
195
return self ._opschema
199
196
200
- def get_schema (self ) -> Optional [onnx .defs .OpSchema ]:
201
- """Returns the ONNX OpSchema for this op."""
202
- if self .opschema is not None :
203
- return self .opschema
204
- return self .opset [self .opname ]
205
-
206
197
def has_schema (self ) -> bool :
207
198
"""Returns True if this op has an OpSchema."""
208
- return self .get_schema () is not None
199
+ return self .opschema is not None
209
200
210
201
def param_schemas (self ) -> Optional [tuple [ParamSchema , ...]]:
211
202
"""Returns the parameter schemas for this op, if it has one."""
212
203
if self ._param_schemas is not None :
213
204
return self ._param_schemas
214
205
215
- op_schema = self .get_schema ()
206
+ op_schema = self .opschema
216
207
if op_schema is None :
217
208
return None
218
209
schemas = []
0 commit comments