33d3c4ca01dd3a1219275346c230006e2c24edad,src/graph_transpiler/webdnn/frontend/onnx/defs/nn.py,,_convert_global_max_pool,#Any#Any#,115

Before Change


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


@ONNXConverter.register_handler("BatchNormalization")
def _convert_batch_normalization(converter: ONNXConverter, onnx_op: INodeProto):

After Change



@ONNXConverter.register_handler("GlobalMaxPool")
def _convert_global_max_pool(converter: ONNXConverter, onnx_op: INodeProto):
    x = converter.get_variable(onnx_op.input[0])
    if x.ndim == 4:
        x.order.unify(OrderNCHW)

    reduction_size = mul(x.shape[2:])
    reduction_axis = Axis()

    x = x.reshape([x.shape[0], x.shape[1], reduction_size],
                  Order([x.order.axes[0], x.order.axes[1], reduction_axis]))
    y, = Max(None, axis=reduction_axis)(x)

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


@ONNXConverter.register_handler("BatchNormalization")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 14

Instances


Project Name: mil-tokyo/webdnn
Commit Name: 33d3c4ca01dd3a1219275346c230006e2c24edad
Time: 2017-12-12
Author: y.kikura@gmail.com
File Name: src/graph_transpiler/webdnn/frontend/onnx/defs/nn.py
Class Name:
Method Name: _convert_global_max_pool


Project Name: mil-tokyo/webdnn
Commit Name: 5cf0a414aa1f7c17fdc0eced712de551c335a25c
Time: 2017-11-30
Author: y.kikura@gmail.com
File Name: src/graph_transpiler/webdnn/frontend/chainer/functions/activation.py
Class Name:
Method Name: _convert_log_softmax


Project Name: mil-tokyo/webdnn
Commit Name: 33d3c4ca01dd3a1219275346c230006e2c24edad
Time: 2017-12-12
Author: y.kikura@gmail.com
File Name: src/graph_transpiler/webdnn/frontend/onnx/defs/nn.py
Class Name:
Method Name: _convert_global_max_pool


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