in onnxconverter_common/optimizer.py [0:0]
def is_eligible_concat_and_inner(self):
"""
Test if a node is eligible_concat_and_inner: multiple input
"""
if self.origin.op_type != 'Concat':
return (False, None)
perm = None
for pre_ in self.precedence:
if len(pre_.successor) > 1:
return (False, None)
if not hasattr(pre_.origin, 'op_type') or pre_.origin.op_type != 'Transpose':
return (False, None)
cur_perm = Solution.get_perm(pre_.origin)
if perm and cur_perm != perm:
return (False, None)
perm = cur_perm
for suc_ in self.successor:
if suc_.in_or_out:
return (False, None)
axis = next(helper.get_attribute_value(attr) for attr in self.origin.attribute if attr.name == 'axis')
if len(perm) <= axis:
if perm == [] and axis == 0:
return (True, -1)
else:
return (False, None)
return (True, perm[axis])