-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMWMaxUnpoolingLayer.cpp
More file actions
37 lines (28 loc) · 1.29 KB
/
Copy pathMWMaxUnpoolingLayer.cpp
File metadata and controls
37 lines (28 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* Copyright 2017 The MathWorks, Inc. */
#include "MWMaxUnpoolingLayer.hpp"
#include "MWMaxUnpoolingLayerImpl.hpp"
#include <stdarg.h>
#include <cassert>
MWMaxUnpoolingLayer::MWMaxUnpoolingLayer()
{
}
MWMaxUnpoolingLayer::~MWMaxUnpoolingLayer()
{
}
void MWMaxUnpoolingLayer::createMaxUnpoolingLayer(MWTargetNetworkImpl* ntwk_impl,
MWTensor* dataInput,
MWTensor* indexInput,
int outbufIdx)
{
setInputTensor(dataInput, 0);
setInputTensor(indexInput, 1);
// Get height and width of input to max pool layer
int outH = indexInput->getOwner()->getInputTensor(0)->getHeight();
int outW = indexInput->getOwner()->getInputTensor(0)->getWidth();
int numOutputFeatures = getInputTensor()->getChannels();
int BatchSize = getInputTensor()->getBatchSize();
allocateOutputTensor(outH, outW, numOutputFeatures, BatchSize, NULL, 0);
m_impl = new MWMaxUnpoolingLayerImpl(this, ntwk_impl, outbufIdx);
MWTensor *opTensor = getOutputTensor();
opTensor->setData(m_impl->getData());
}