| 117 | } |
| 118 | |
| 119 | bool broadcastIOFormats(std::vector<IOFormat> const& formats, size_t nbBindings, bool isInput /*= true*/) |
| 120 | { |
| 121 | bool broadcast = formats.size() == 1; |
| 122 | bool validFormatsCount = broadcast || (formats.size() == nbBindings); |
| 123 | if (!formats.empty() && !validFormatsCount) |
| 124 | { |
| 125 | if (isInput) |
| 126 | { |
| 127 | throw std::invalid_argument( |
| 128 | "The number of inputIOFormats must match network's inputs or be one for broadcasting."); |
| 129 | } |
| 130 | |
| 131 | throw std::invalid_argument( |
| 132 | "The number of outputIOFormats must match network's outputs or be one for broadcasting."); |
| 133 | } |
| 134 | return broadcast; |
| 135 | } |
| 136 | |
| 137 | void sparsifyMatMulKernelWeights(nvinfer1::INetworkDefinition& network, std::vector<std::vector<int8_t>>& sparseWeights) |
| 138 | { |
no test coverage detected