#include "Conv2D.h"
#include "Assert.h"
#include "internal/Spatial.h"
Go to the source code of this file.
|
bool | convPrepare (const Shape &input, const Shape &filter, const Shape &bias, int32_t padding_left, int32_t padding_right, int32_t padding_top, int32_t padding_bottom, int32_t stride_width, int32_t stride_height, Shape *output) |
|
◆ convPrepare()
bool convPrepare |
( |
const Shape & |
input, |
|
|
const Shape & |
filter, |
|
|
const Shape & |
bias, |
|
|
int32_t |
padding_left, |
|
|
int32_t |
padding_right, |
|
|
int32_t |
padding_top, |
|
|
int32_t |
padding_bottom, |
|
|
int32_t |
stride_width, |
|
|
int32_t |
stride_height, |
|
|
Shape * |
output |
|
) |
| |
Definition at line 23 of file Conv2D.cpp.
26{
28 if (
input.type == OperandType::TENSOR_QUANT8_ASYMM)
29 {
30 ASSERT(
bias.type == OperandType::TENSOR_INT32);
31 }
32 else
33 {
35 }
39
42
49
50 uint32_t outWidth =
computeOutSize(width, filterWidth, stride_width, padding_left, padding_right);
51 uint32_t outHeight =
52 computeOutSize(height, filterHeight, stride_height, padding_top, padding_bottom);
53
55 output->dimensions = {batches, outHeight, outWidth, channels_out};
56 return true;
57}
uint32_t computeOutSize(uint32_t imageSize, uint32_t filterSize, uint32_t stride, uint32_t paddingHead, uint32_t paddingTail)
uint32_t getSizeOfDimension(const Shape &shape, uint32_t dimensionIdx)
uint32_t getNumberOfDimensions(const Shape &shape)
References ASSERT, computeOutSize(), getNumberOfDimensions(), and getSizeOfDimension().