mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 12:40:05 +08:00
Fix Vulkan's max pooling in case of no output indices
This commit is contained in:
parent
8409aa9eba
commit
ef5d921eac
@ -90,16 +90,10 @@ bool OpPool::forward(std::vector<Tensor>& ins,
|
||||
std::vector<Tensor>& blobs,
|
||||
std::vector<Tensor>& outs)
|
||||
{
|
||||
for (size_t ii = 0; ii < ins.size(); ii++)
|
||||
{
|
||||
Tensor& inpMat = ins[ii];
|
||||
int out_index = (pool_type_ == kPoolTypeMax) ? 2 : 1;
|
||||
Tensor& outMat = outs[out_index * ii];
|
||||
Tensor maskMat = (pool_type_ == kPoolTypeMax) ? outs[2 * ii + 1] : Tensor();
|
||||
if (!forward(inpMat, outMat, maskMat))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
Tensor& inpMat = ins[0];
|
||||
Tensor& outMat = outs[0];
|
||||
Tensor maskMat = outs.size() > 1 ? outs[1] : Tensor();
|
||||
return forward(inpMat, outMat, maskMat);
|
||||
}
|
||||
|
||||
bool OpPool::forward(Tensor& in, Tensor& out, Tensor& mask)
|
||||
|
Loading…
Reference in New Issue
Block a user