32 for (
unsigned int inputIdx=0; inputIdx<numInputs; ++inputIdx)
34 for (
unsigned int elmt=0; elmt<inputLength; ++elmt)
36 (*inputs[inputIdx])[elmt];
37 output[(inputIdx * inputLength) + elmt];
38 output.
Set(inputs[inputIdx]->Get());
44 const unsigned int iNumTensors =
static_cast<unsigned int>(data.
m_Inputs.size());
45 const unsigned int iBatchSize = inputDims[0];
46 const unsigned int iChannels = (inputNumDims > 1) ? inputDims[1] : 1;
47 const unsigned int iHeight = (inputNumDims > 2) ? inputDims[2] : 1;
48 const unsigned int iWidth = (inputNumDims > 3) ? inputDims[3] : 1;
50 const unsigned int oBatchSize = outputDims[1];
51 const unsigned int oChannels = (outputNumDims > 2) ? outputDims[2] : 1;
52 const unsigned int oHeight = (outputNumDims > 3) ? outputDims[3] : 1;
53 const unsigned int oWidth = (outputNumDims > 4) ? outputDims[4] : 1;
60 std::array<unsigned int, 6> iCoordinates{ 0 };
64 std::array<unsigned int *, 5> oCoordinates = { &iCoordinates[5],
71 oCoordinates[axis] = &iCoordinates[0];
74 unsigned int dim_shift = 0;
75 for(
unsigned int dim = 0; dim < inputNumDims; ++dim)
81 oCoordinates[dim + dim_shift] = &iCoordinates[dim + 1];
85 unsigned int &i = iCoordinates[0];
86 unsigned int &bi = iCoordinates[1];
87 unsigned int &ci = iCoordinates[2];
88 unsigned int &hi = iCoordinates[3];
89 unsigned int &wi = iCoordinates[4];
92 unsigned int &o = *(oCoordinates[0]);
93 unsigned int &bo = *(oCoordinates[1]);
94 unsigned int &co = *(oCoordinates[2]);
95 unsigned int &ho = *(oCoordinates[3]);
96 unsigned int &wo = *(oCoordinates[4]);
99 for(; i < iNumTensors; ++(i))
101 for(bi = 0; bi < iBatchSize; ++(bi))
103 for(ci = 0; ci < iChannels; ++(ci))
105 for(hi = 0; hi < iHeight; ++(hi))
107 for(wi = 0; wi < iWidth; ++(wi))
109 output[o * oWidth * oHeight * oChannels * oBatchSize +
110 bo * oWidth * oHeight * oChannels +
111 co * oWidth * oHeight +
115 output.
Set(inputs[i]->Get());