Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
ONNX export: MaxRoiPool
Browse files Browse the repository at this point in the history
  • Loading branch information
vandanavk committed Jan 9, 2019
1 parent 497d3c4 commit 1deadd4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,3 +1790,24 @@ def convert_random_normal(node, **kwargs):
name=name
)
return [node]


@mx_op.register("ROIPooling")
def convert_roipooling(node, **kwargs):
"""Map MXNet's ROIPooling operator attributes to onnx's MaxRoiPool
operator and return the created node.
"""
name, input_nodes, attrs = get_inputs(node, kwargs)

pooled_shape = convert_string_to_list(attrs.get('pooled_size'))
scale = float(attrs.get("spatial_scale"))

node = onnx.helper.make_node(
'MaxRoiPool',
input_nodes,
[name],
pooled_shape=pooled_shape,
spatial_scale=scale,
name=name
)
return [node]

0 comments on commit 1deadd4

Please sign in to comment.