Fully Connected Layer */
| 716 | |
| 717 | /** Fully Connected Layer */ |
| 718 | class FullyConnectedLayer final : public ILayer |
| 719 | { |
| 720 | public: |
| 721 | /** Construct a fully connected layer. |
| 722 | * |
| 723 | * @param[in] num_outputs Number of outputs. |
| 724 | * @param[in] weights Accessor to get weights from. |
| 725 | * @param[in] bias Accessor to get bias from. |
| 726 | * @param[in] fc_info (Optional) Fully connected layer metadata |
| 727 | * @param[in] weights_quant_info (Optional) Weights quantization information |
| 728 | * @param[in] out_quant_info (Optional) Output quantization info |
| 729 | */ |
| 730 | FullyConnectedLayer(unsigned int num_outputs, |
| 731 | ITensorAccessorUPtr weights, |
| 732 | ITensorAccessorUPtr bias, |
| 733 | const FullyConnectedLayerInfo fc_info = FullyConnectedLayerInfo(), |
| 734 | const QuantizationInfo weights_quant_info = QuantizationInfo(), |
| 735 | const QuantizationInfo out_quant_info = QuantizationInfo()) |
| 736 | : _num_outputs(num_outputs), |
| 737 | _weights(std::move(weights)), |
| 738 | _bias(std::move(bias)), |
| 739 | _weights_ss(nullptr), |
| 740 | _bias_ss(nullptr), |
| 741 | _fc_info(fc_info), |
| 742 | _weights_quant_info(std::move(weights_quant_info)), |
| 743 | _out_quant_info(std::move(out_quant_info)) |
| 744 | { |
| 745 | } |
| 746 | |
| 747 | /** Construct a fully connected layer. |
| 748 | * |
| 749 | * @param[in] num_outputs Number of outputs. |
| 750 | * @param[in] sub_stream_weights Graph sub-stream for the weights. |
| 751 | * @param[in] sub_stream_bias Graph sub-stream for the bias. |
| 752 | * @param[in] fc_info (Optional) Fully connected layer metadata |
| 753 | * @param[in] weights_quant_info (Optional) Weights quantization information |
| 754 | * @param[in] out_quant_info (Optional) Output quantization info |
| 755 | */ |
| 756 | FullyConnectedLayer(unsigned int num_outputs, |
| 757 | SubStream sub_stream_weights, |
| 758 | SubStream sub_stream_bias, |
| 759 | const FullyConnectedLayerInfo fc_info = FullyConnectedLayerInfo(), |
| 760 | const QuantizationInfo weights_quant_info = QuantizationInfo(), |
| 761 | const QuantizationInfo out_quant_info = QuantizationInfo()) |
| 762 | : _num_outputs(num_outputs), |
| 763 | _weights(nullptr), |
| 764 | _bias(nullptr), |
| 765 | _weights_ss(std::make_unique<SubStream>(std::move(sub_stream_weights))), |
| 766 | _bias_ss(std::make_unique<SubStream>(std::move(sub_stream_bias))), |
| 767 | _fc_info(fc_info), |
| 768 | _weights_quant_info(std::move(weights_quant_info)), |
| 769 | _out_quant_info(std::move(out_quant_info)) |
| 770 | { |
| 771 | } |
| 772 | |
| 773 | /** Create layer and add to the given stream. |
| 774 | * |
| 775 | * @param[in] s Stream to add layer to. |
no outgoing calls
no test coverage detected