18 const std::vector<int32_t>& indicesData)
27 Connect(paramsLayer, gatherLayer, paramsInfo, 0, 0);
28 Connect(indicesLayer, gatherLayer, indicesInfo, 0, 1);
29 Connect(gatherLayer, outputLayer, outputInfo, 0, 0);
34 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
35 void GatherEndToEnd(
const std::vector<BackendId>& backends)
47 std::vector<T> paramsData{
48 1, 2, 3, 4, 5, 6, 7, 8
51 std::vector<int32_t> indicesData{
55 std::vector<T> expectedOutput{
60 armnn::INetworkPtr net = CreateGatherNetwork(paramsInfo, indicesInfo, outputInfo, indicesData);
62 BOOST_TEST_CHECKPOINT(
"create a network");
64 std::map<int, std::vector<T>> inputTensorData = {{ 0, paramsData }};
65 std::map<int, std::vector<T>> expectedOutputData = {{ 0, expectedOutput }};
67 EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(net), inputTensorData, expectedOutputData, backends);
70 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
71 void GatherMultiDimEndToEnd(
const std::vector<BackendId>& backends)
83 std::vector<T> paramsData{
94 std::vector<int32_t> indicesData{
99 std::vector<T> expectedOutput{
116 armnn::INetworkPtr net = CreateGatherNetwork(paramsInfo, indicesInfo, outputInfo, indicesData);
118 BOOST_TEST_CHECKPOINT(
"create a network");
120 std::map<int, std::vector<T>> inputTensorData = {{ 0, paramsData }};
121 std::map<int, std::vector<T>> expectedOutputData = {{ 0, expectedOutput }};
123 EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(net), inputTensorData, expectedOutputData, backends);
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
A GatherDescriptor for the GatherLayer.
void SetQuantizationScale(float scale)
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
static INetworkPtr Create(NetworkOptions networkOptions={})