18 std::vector<uint32_t> coordinates;
20 for (std::size_t i = shape.size() - 1; i < shape.size(); --i)
24 coordinates.insert(coordinates.begin(), index % shape[i]);
26 index = index/shape[i];
37 for (uint32_t i = rank; i > 0; --i)
39 index = index + coordinates[i - 1] * base;
40 base = base * shape[i - 1];
55 std::vector<uint32_t> outputShape(rank);
56 for (uint32_t i = 0; i < rank; ++i)
58 outputShape[i] = inputShape[i] * params.
m_Multiples[i];
67 float inputValue = inputDecoder.
Get();
69 outputEncoder.
Set(inputValue);
76 std::vector<float> outputData;
77 auto outputNumElements = inputData.size() *
static_cast<uint32_t
>(std::accumulate(begin(params.
m_Multiples),
80 std::multiplies<>()));
81 outputData.reserve(outputNumElements);
83 for (uint32_t outputIndex = 0; outputIndex < outputNumElements; ++outputIndex)
88 std::vector<uint32_t> inputCoordinates;
89 inputCoordinates.reserve(rank);
90 for (uint32_t i = 0; i < rank; ++i)
92 inputCoordinates.push_back(outputCoords[i] % inputShape[i]);
97 outputEncoder[outputIndex];
98 outputEncoder.
Set(inputData[inputIndex]);