Source code for mlprodict.onnxrt.ops_cpu.op_reduce_max
# -*- encoding: utf-8 -*-
# pylint: disable=E0203,E1101,C0111
"""
Runtime operator.
:githublink:`%|py|7`
"""
import numpy
from ._op import OpRunReduceNumpy
[docs]class ReduceMax(OpRunReduceNumpy):
atts = {'axes': [], 'keepdims': 1}
[docs] def __init__(self, onnx_node, desc=None, **options):
OpRunReduceNumpy.__init__(self, onnx_node, desc=desc,
expected_attributes=ReduceMax.atts,
**options)
[docs] def _run(self, data): # pylint: disable=W0221
axes = tuple(self.axes) if self.axes else None
return (numpy.maximum.reduce(data, axis=axes, # pylint: disable=E1123
keepdims=self.keepdims == 1), )