-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REGION op removed from topi and added in darkent frontend #2275
Conversation
41af088
to
36497d4
Compare
36497d4
to
35e4534
Compare
please request reviews |
What is the status on this PR? |
@siju-samuel please rebase the PR against the latest master |
@srkreddy1238 @PariksheetPinjari909 please review |
nnvm/python/nnvm/frontend/darknet.py
Outdated
data_block_1 = splits[:offset] | ||
splits = data_block_1 + [softmax_output] | ||
concat_out = _sym.concatenate(*splits, axis=2) | ||
return _sym.reshape(concat_out, shape=input_shape), None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split the data block at (2, 4, 5) locations and apply sigmoid and softmax as follows:
data_block = _sym.reshape(inputs[0], shape=intermediate_shape)
split_indices = (2, 4, 5)
split_res = _sym.split(data_block, indices_or_sections=split_indices, axis=2)
split_res0 = _sym.sigmoid(split_res[0])
if not background:
split_res2 = _sym.sigmoid(split_res[2])
else:
split_res2 = split_res[2]
if softmax:
split_res3 = _sym.softmax(split_res[3], axis=2)
concat_list = [split_res0, split_res[1], split_res2, split_res3]
out = _sym.concatenate(*concat_list, axis=2)
return _sym.reshape(out, shape=input_shape), None
@siju-samuel please act on the comments |
The
region
op is used only in darknet and since its not generic and can be acheived by frontend itself, i implemented the op indarknet.py
and removed all the existing region_op registration, testcases and topi code.This will be helpful when migrating to
relay
as from relay,region
op is not added.Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers.