File tree 1 file changed +4
-10
lines changed
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 21
21
"""
22
22
23
23
import copy
24
- import functools
25
24
import random
26
25
import re
27
26
import struct
@@ -490,12 +489,7 @@ def get_options_as(
490
489
):
491
490
raise err
492
491
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 ):
499
493
if not is_opt_1_type :
500
494
enum_val = getattr (schema_fb .BuiltinOptions2 , base_type_name )
501
495
opts_creator = schema_fb .BuiltinOptions2Creator
@@ -510,8 +504,7 @@ def _(op: schema_fb.Operator):
510
504
return None
511
505
return opts_creator (enum_val , raw_ops )
512
506
513
- @_get_opts .register
514
- def _ (op : schema_fb .OperatorT ):
507
+ elif isinstance (op , schema_fb .OperatorT ):
515
508
if is_opt_1_type :
516
509
raw_ops_t = op .builtinOptions
517
510
else :
@@ -520,4 +513,5 @@ def _(op: schema_fb.OperatorT):
520
513
return None
521
514
return raw_ops_t
522
515
523
- return _get_opts (op )
516
+ else :
517
+ return None
You can’t perform that action at this time.
0 commit comments