MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / broadcastIOFormats

Function broadcastIOFormats

samples/common/sampleUtils.cpp:119–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119bool 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
137void sparsifyMatMulKernelWeights(nvinfer1::INetworkDefinition& network, std::vector<std::vector<int8_t>>& sparseWeights)
138{

Callers 2

setupNetworkAndConfigFunction · 0.85

Calls 2

sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected