@@ -273,16 +273,13 @@ def __call__(self, *args, **kwargs):
273
273
# FIXME(after #225): Move import to the top of the file.
274
274
from onnxscript import evaluator # pylint: disable=import-outside-toplevel
275
275
276
- schema = self .get_schema ()
276
+ schema = self .opschema
277
277
if schema is None :
278
278
raise RuntimeError (
279
279
f"Op '{ self .name } ' does not have an OpSchema and cannot be evaluated."
280
280
)
281
281
return evaluator .default ().eval (schema , args , kwargs )
282
282
283
- def is_single_op (self ) -> bool :
284
- return isinstance (self .name , str )
285
-
286
283
@property
287
284
def name (self ) -> str :
288
285
return self ._name
@@ -295,22 +292,16 @@ def opset(self) -> Opset:
295
292
def opschema (self ) -> Optional [onnx .defs .OpSchema ]:
296
293
return self ._opschema
297
294
298
- def get_schema (self ) -> Optional [onnx .defs .OpSchema ]:
299
- """Returns the ONNX OpSchema for this op."""
300
- if self .opschema is not None :
301
- return self .opschema
302
- return self .opset [self .name ]
303
-
304
295
def has_schema (self ) -> bool :
305
296
"""Returns True if this op has an OpSchema."""
306
- return self .get_schema () is not None
297
+ return self .opschema is not None
307
298
308
299
def param_schemas (self ) -> Optional [tuple [ParamSchema , ...]]:
309
300
"""Returns the parameter schemas for this op, if it has one."""
310
301
if self ._param_schemas is not None :
311
302
return self ._param_schemas
312
303
313
- op_schema = self .get_schema ()
304
+ op_schema = self .opschema
314
305
if op_schema is None :
315
306
return None
316
307
0 commit comments