Coverage for mlprodict/onnxrt/ops_cpu/op_sequence_insert.py: 100%
12 statements
« prev ^ index » next coverage.py v7.1.0, created at 2023-02-04 02:28 +0100
« prev ^ index » next coverage.py v7.1.0, created at 2023-02-04 02:28 +0100
1# -*- encoding: utf-8 -*-
2# pylint: disable=E0203,E1101,C0111
3"""
4@file
5@brief Runtime operator.
7.. versionadded:: 0.7
8"""
9from ._op import OpRun
12class SequenceInsert(OpRun):
14 atts = {'axis': 0, 'new_axis': 0}
16 def __init__(self, onnx_node, desc=None, **options):
17 OpRun.__init__(self, onnx_node, desc=desc,
18 atts=SequenceInsert.atts, **options)
20 def _run(self, S, T, ind=None, attributes=None, verbose=0, fLOG=None): # pylint: disable=W0221
21 S = S.copy()
22 if ind is not None:
23 S.insert(ind[0], T)
24 else:
25 S.append(T)
26 return (S, )