Source code for mlprodict.onnxrt.ops_cpu.op_identity

# -*- encoding: utf-8 -*-
# pylint: disable=E0203,E1101,C0111
"""
Runtime operator.


:githublink:`%|py|7`
"""
from ._op import OpRunUnaryNum


[docs]class Identity(OpRunUnaryNum):
[docs] def __init__(self, onnx_node, desc=None, **options): OpRunUnaryNum.__init__(self, onnx_node, desc=desc, **options)
[docs] def _run(self, a): # pylint: disable=W0221 if self.inplaces.get(0, False): return (a, ) return (a.copy(), )
[docs] def to_python(self, inputs): return "", "return %s.copy()" % inputs[0]