30 std::vector<ITensorHandle*> outputs)
const 36 std::unique_ptr<Decoder<float>> decoderPtr = MakeDecoder<float>(inputInfo, inputs[0]->Map());
39 std::unique_ptr<Encoder<float>> encoderPtr = MakeEncoder<float>(outputInfo, outputs[0]->Map());
42 auto getNumberOfElements = [](
const TensorShape& tensorShape,uint32_t startAxis, uint32_t lastAxis)
45 for (uint32_t i = startAxis; i < lastAxis; i++)
47 count *= tensorShape[i];
55 const uint32_t groupSize = tensorShape[channelsAxis] / numGroups;
57 uint32_t outerSize = getNumberOfElements(tensorShape, 0, channelsAxis);
58 uint32_t innerSize = getNumberOfElements(tensorShape, channelsAxis + 1, tensorShape.
GetNumDimensions());
60 for (uint32_t outer = 0; outer < outerSize; ++outer)
62 for (uint32_t inner = 0; inner < innerSize; ++inner)
64 uint32_t decoderStep1 = outer * tensorShape[channelsAxis] * innerSize + inner;
65 decoder += decoderStep1;
66 uint32_t encoderStep1 = outer * tensorShape[channelsAxis] * innerSize + inner;
67 encoder += encoderStep1;
68 for (uint32_t i = 0; i < groupSize; i++)
70 for (uint32_t j = 0; j < numGroups; j++, encoder += innerSize, encoderStep1 += innerSize)
72 decoder += innerSize * (i + j * groupSize);
73 float decoded = decoder.Get();
75 decoder -= innerSize * (i + j * groupSize);
78 decoder -= decoderStep1;
79 encoder -= encoderStep1;
const TensorShape & GetShape() const
CPU Execution: Reference C++ kernels.
Copyright (c) 2021 ARM Limited and Contributors.
LayerDescriptor m_Parameters
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
std::vector< ITensorHandle * > m_Inputs
ChannelShuffleQueueDescriptor m_Data
uint32_t m_NumGroups
Number of groups for the channel shuffle operation.
std::vector< ITensorHandle * > m_Outputs
void Execute() const override
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
void ExecuteAsync(ExecutionData &executionData) override
std::vector< ITensorHandle * > m_Outputs
uint32_t m_Axis
Axis to apply channel shuffle operation on.
std::vector< ITensorHandle * > m_Inputs
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers