Source code for mlprodict.onnxrt.ops_cpu.op_not

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


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


[docs]class Not(OpRunUnary):
[docs] def __init__(self, onnx_node, desc=None, **options): OpRunUnary.__init__(self, onnx_node, desc=desc, **options)
[docs] def _run(self, x): # pylint: disable=W0221 return (numpy.logical_not(x), )
[docs] def _infer_shapes(self, x): # pylint: disable=W0221 return (x.copy(dtype=numpy.bool), )
[docs] def to_python(self, inputs): return self._to_python_numpy(inputs, 'logical_not')