Skip to content

Commit

Permalink
adaptive pooling added to relay
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurawly committed Mar 27, 2019
1 parent 9ace1cb commit 1119f1f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/tvm/relay/frontend/mxnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ def _pool2d(new_op, is_avg):
raise RuntimeError("Do not support pool_type:{}".format(pool_type))


def _mx_adaptive_pooling(inputs, attrs):
output_size = attrs.get_int_tupple("output_size", [])
print(output_size)
if output_size != 1:
raise RuntimeError("AdaptiveAvgPooling with output_size other than 1 is not supported yet.")
return _op.nn.global_avg_pool2d(inputs[0])


def _mx_dropout(inputs, attrs):
rate = attrs.get_float("p", 0.5)
return _op.nn.dropout(inputs[0], rate=rate)
Expand Down Expand Up @@ -707,6 +715,7 @@ def _mx_embedding(inputs, _):
"_contrib_MultiBoxDetection" : _mx_multibox_detection,
"_contrib_ROIAlign" : _mx_roi_align,
"ROIPooling" : _mx_roi_pooling,
"AdaptiveAvgPooling2D" : _mx_adaptive_pooling,
"_contrib_Proposal" : _mx_proposal,
"_contrib_MultiProposal" : _mx_proposal,
"_contrib_box_nms" : _mx_box_nms,
Expand Down

0 comments on commit 1119f1f

Please sign in to comment.