File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 2121"""
2222
2323import copy
24- import functools
2524import random
2625import re
2726import struct
@@ -490,12 +489,7 @@ def get_options_as(
490489 ):
491490 raise err
492491
493- @functools .singledispatch
494- def _get_opts (unused_op ):
495- return None
496-
497- @_get_opts .register
498- def _ (op : schema_fb .Operator ):
492+ if isinstance (op , schema_fb .Operator ):
499493 if not is_opt_1_type :
500494 enum_val = getattr (schema_fb .BuiltinOptions2 , base_type_name )
501495 opts_creator = schema_fb .BuiltinOptions2Creator
@@ -510,8 +504,7 @@ def _(op: schema_fb.Operator):
510504 return None
511505 return opts_creator (enum_val , raw_ops )
512506
513- @_get_opts .register
514- def _ (op : schema_fb .OperatorT ):
507+ elif isinstance (op , schema_fb .OperatorT ):
515508 if is_opt_1_type :
516509 raw_ops_t = op .builtinOptions
517510 else :
@@ -520,4 +513,5 @@ def _(op: schema_fb.OperatorT):
520513 return None
521514 return raw_ops_t
522515
523- return _get_opts (op )
516+ else :
517+ return None
You can’t perform that action at this time.
0 commit comments