13 #include <doctest/doctest.h> 26 Connect(inputLayer, channelShuffleLayer, inputInfo, 0, 0);
27 Connect(channelShuffleLayer, outputLayer, outputInfo, 0, 0);
32 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
33 void ChannelShuffleEndToEnd(
const std::vector<BackendId>& backends)
45 std::vector<T> inputData{
46 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
47 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
48 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35
51 std::vector<T> expectedOutput{
52 0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11,
53 12, 16, 20, 13, 17, 21, 14, 18, 22, 15, 19, 23,
54 24, 28, 32, 25, 29, 33, 26, 30, 34, 27, 31, 35
56 ChannelShuffleDescriptor descriptor;
58 descriptor.m_NumGroups = 3;
61 armnn::INetworkPtr net = CreateChannelShuffleNetwork(inputInfo, outputInfo, descriptor);
65 std::map<int, std::vector<T>> inputTensorData = {{ 0, inputData }};
66 std::map<int, std::vector<T>> expectedOutputData = {{ 0, expectedOutput }};
68 EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(net), inputTensorData, expectedOutputData, backends);
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
void SetQuantizationScale(float scale)
void SetConstant(const bool IsConstant=true)
Marks the data corresponding to this tensor info as constant.
uint32_t m_Axis
Axis to apply channel shuffle operation on.
void SetQuantizationOffset(int32_t offset)
void Connect(armnn::IConnectableLayer *from, armnn::IConnectableLayer *to, const armnn::TensorInfo &tensorInfo, unsigned int fromIndex, unsigned int toIndex)
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
A ChannelShuffleDescriptor for the ChannelShuffle operator.
static INetworkPtr Create(NetworkOptions networkOptions={})