15 #include <boost/test/unit_test.hpp> 37 Connect(inputLayer, fullyConnectedLayer, inputTensorInfo, 0, 0);
38 Connect(weightsInputLayer, fullyConnectedLayer, weightsTensorInfo, 0, 1);
39 Connect(fullyConnectedLayer, outputLayer, outputTensorInfo, 0, 0);
44 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
45 void FullyConnectedWithDynamicWeightsEndToEnd(
const std::vector<armnn::BackendId>& backends)
47 using namespace armnn;
66 std::vector<T> inputData {
71 std::vector<T> weightsData {
72 -8.4f, 20.0f, -10.4f, -8, 16.4f, -11.8f,
73 23.4f, 10.4f, -14.0f, -3.8f, -11.8f, 11.4f
76 std::vector<T> floatExpectedOutputData {
79 std::vector<T> expectedOutputData = armnnUtils::QuantizedVector<T>(floatExpectedOutputData);
81 armnn::INetworkPtr network = CreateFullyConnectedNetworkNonConstWeights(inputTensorInfo,
86 BOOST_TEST_CHECKPOINT(
"create a network");
88 std::map<int, std::vector<T>> inputTensorData = {{ 0, inputData }, {1, weightsData}};
89 std::map<int, std::vector<T>> expectedOutputTensorData = {{ 0, expectedOutputData }};
91 EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(network),
93 expectedOutputTensorData,
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
bool m_TransposeWeightMatrix
Enable/disable transpose weight matrix.
Copyright (c) 2021 ARM Limited and Contributors.
A FullyConnectedDescriptor for the FullyConnectedLayer.
bool m_BiasEnabled
Enable/disable bias.
void SetQuantizationScale(float scale)
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
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={})
bool m_ConstantWeights
Enable/disable constant weights and biases.