84b1ba07f8f80313f7a7853db2aa3cf9f5adf441,src/graph_transpiler/webdnn/frontend/onnx/defs/reduction.py,,_convert_reduce_min,#Any#Any#,16

Before Change


@ONNXConverter.register_handler("ReduceMin")
def _convert_reduce_min(converter: ONNXConverter, onnx_op: INodeProto):
    // FIXME: It"s possible to support in current version of webdnn
    raise NotImplementedError("[ONNXConverter] Operator \"ReduceMin\" is not supported yet.")


@ONNXConverter.register_handler("ReduceSum")
def _convert_reduce_sum(converter: ONNXConverter, onnx_op: INodeProto):

After Change



@ONNXConverter.register_handler("ReduceMin")
def _convert_reduce_min(converter: ONNXConverter, onnx_op: INodeProto):
    x = converter.get_variable(onnx_op.input[0])

    attrs = attribute_dict(onnx_op)
    axes = attrs["axes"].ints
    keepdims = (attrs["keepdims"].i if "keepdims" in attrs else 1) == 1
    for a in axes:
        x, = Min(None, axis=x.order.axes[a])(x)

    if not keepdims:
        x = x.squeeze(axis=[x.order.axes[i] for i in axes])

    converter.set_variable(onnx_op.output[0], x)


@ONNXConverter.register_handler("ReduceSum")
def _convert_reduce_sum(converter: ONNXConverter, onnx_op: INodeProto):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 37

Instances


Project Name: mil-tokyo/webdnn
Commit Name: 84b1ba07f8f80313f7a7853db2aa3cf9f5adf441
Time: 2017-12-12
Author: y.kikura@gmail.com
File Name: src/graph_transpiler/webdnn/frontend/onnx/defs/reduction.py
Class Name:
Method Name: _convert_reduce_min


Project Name: mil-tokyo/webdnn
Commit Name: 84b1ba07f8f80313f7a7853db2aa3cf9f5adf441
Time: 2017-12-12
Author: y.kikura@gmail.com
File Name: src/graph_transpiler/webdnn/frontend/onnx/defs/reduction.py
Class Name:
Method Name: _convert_reduce_min


Project Name: mil-tokyo/webdnn
Commit Name: 84b1ba07f8f80313f7a7853db2aa3cf9f5adf441
Time: 2017-12-12
Author: y.kikura@gmail.com
File Name: src/graph_transpiler/webdnn/frontend/onnx/defs/reduction.py
Class Name:
Method Name: _convert_reduce_max


Project Name: mil-tokyo/webdnn
Commit Name: 84b1ba07f8f80313f7a7853db2aa3cf9f5adf441
Time: 2017-12-12
Author: y.kikura@gmail.com
File Name: src/graph_transpiler/webdnn/frontend/onnx/defs/reduction.py
Class Name:
Method Name: _convert_reduce_prod


Project Name: mil-tokyo/webdnn
Commit Name: 84b1ba07f8f80313f7a7853db2aa3cf9f5adf441
Time: 2017-12-12
Author: y.kikura@gmail.com
File Name: src/graph_transpiler/webdnn/frontend/onnx/defs/reduction.py
Class Name:
Method Name: _convert_reduce_sum