Repository navigation
Conversation
4e91057 to
d995d5f
Compare
d995d5f to
04c215f
Compare
|
@ashishkrshrivastava, please review this PR. It adds one more fusion in case of no Cast op in Upsample subgraph (#16323 (comment)) from PyTorch 1.2. |
| float scaleH = getMatFromTensor(tensor_proto).at<float>(0); | ||
| Mat scaleH = getMatFromTensor(tensor_proto); | ||
| CV_Assert(scaleH.total() == 1); | ||
| scaleH.convertTo(scaleH, CV_32F); |
There was a problem hiding this comment.
It was needed. graph created by Pytorch 1.2 has scales as int64 datatypes whereas Pytorch 1.4 has scales as float32.
| subgraphs.push_back(makePtr<ResizeSubgraph2>(true)); | ||
| subgraphs.push_back(makePtr<UpsampleSubgraph>(false)); | ||
| subgraphs.push_back(makePtr<ResizeSubgraph1>(false)); | ||
| subgraphs.push_back(makePtr<ResizeSubgraph2>(false)); |
There was a problem hiding this comment.
If we deal Mul-cast according to these changes( Gather-cast) then we will have to check 12 subgraphs ?
for example -
subgraphs.push_back(makePtr<ResizeSubgraph2>(true, true));
subgraphs.push_back(makePtr<ResizeSubgraph2>(true, false));
And if we deal Mul-cast the way it is in PR #16709 and Gather-cast according to these changes then we would be doing similar thing in two different ways.
If you say, I can make changes in PR #16709 similar to this PR, otherwise maybe you can add changes for Mul-cast here in this PR similar to Gather-cast?
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
resolves #16323
resolves #16660
Merge with extra: opencv/opencv_extra#716
Patch to opencv_extra has the same branch name.