masahi commented on a change in pull request #8174:
URL: https://github.com/apache/tvm/pull/8174#discussion_r644302217



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -793,6 +793,92 @@ def _impl(inputs, attr, params, mod):
     return _impl
 
 
+def convert_combined_nms_with_all_class_nms(
+    batch_size,
+    max_output_boxes_per_batch,
+    num_class,
+    boxes,
+    scores,
+    max_output_boxes_per_class,
+    iou_threshold,
+    score_threshold,
+    max_total_size,
+    clip_boxes,
+):
+    """Converts TF combined_nms using Relay all_class_max_suppression op"""
+    (selected_indices, selected_scores, num_detections,) = 
_op.vision.all_class_non_max_suppression(
+        boxes,
+        scores,
+        max_output_boxes_per_class,
+        iou_threshold,
+        score_threshold,
+        output_format="tensorflow",
+    )
+    box_range = _op.arange(
+        _op.const(0, dtype="int64"), _op.const(max_total_size, dtype="int64"), 
dtype="int64"
+    )
+    tile_batch_reps = (
+        _op.concatenate([batch_size, 1], axis=0)

Review comment:
       oops you are right. Actually the existing converter does not seem to 
support both dynamic batch and num boxes either: 
https://github.com/apache/tvm/blob/6baccc1305b13f18ce8ac5db5fcbbadb8c278454/python/tvm/relay/frontend/tensorflow.py#L827-L828
   
   So I'll just add an assertion to check if batch_size and num_boxes are 
integers and raise an error otherwise.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to