Skip to content

Conversation

@masahi
Copy link
Member

@masahi masahi commented Jan 15, 2019

Fixes #2431. In #2187, I was making a false assumption that the number of fields of a tuple nodes is the same as the number of parameters to a function containing the tuple. But this is not always the case, since the field value can be generated inside the function (or group).

For example, the gluon SSD model returns class ids, bounding box scores, and locations, shown below. After converting to Relay, the three outputs are put into a tuple. Three slice_axis and the last tuple are put into the same group. This group has one parameter, result, but the tuple has three fields. This caused out of bounds access in #2431.

  result = ...
  ids = F.slice_axis(result, axis=2, begin=0, end=1)
  scores = F.slice_axis(result, axis=2, begin=1, end=2)
  bboxes = F.slice_axis(result, axis=2, begin=2, end=6)
  return ids, scores, bboxes

@tqchen @kevinthesun @jroesch please review.

@masahi masahi changed the title fix handling a tuple node in op fusion [Relay] Fix handling a tuple node in op fusion Jan 15, 2019
@tqchen tqchen merged commit 749cb21 into apache:master Jan 15, 2019
@tqchen
Copy link
Member

tqchen commented Jan 15, 2019

Thanks @masahi , this is now merged

tqchen added a commit that referenced this pull request Jan 15, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants