Source code for mlprodict.onnxrt.ops_cpu.op_pow

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


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


[docs]class Pow(OpRun):
[docs] def __init__(self, onnx_node, desc=None, **options): OpRun.__init__(self, onnx_node, desc=desc, **options)
[docs] def _run(self, a, b): # pylint: disable=W0221 return (numpy.power(a, b), )
[docs] def _infer_shapes(self, x, b): # pylint: disable=W0221 """ Returns the same shape by default. :githublink:`%|py|22` """ return (x, )
[docs] def to_python(self, inputs): return self._to_python_numpy(inputs, 'power')