20 #include <fmt/format.h>
30 switch (inputDataType)
32 case DataType::Float16:
33 return DataType::Float16;
35 case DataType::Float32:
36 return DataType::Float32;
37 case DataType::QAsymmS8:
38 case DataType::QAsymmU8:
39 case DataType::QSymmS8:
40 case DataType::QSymmS16:
41 return DataType::Signed32;
44 return DataType::Float32;
54 std::string to_string(T value)
56 std::ostringstream os;
62 void ValidatePointer(
const void* ptr, std::string
const& descName, std::string
const& paramName)
67 paramName +
" parameter must be set.");
72 void ValidateTensorShapesMatch(
const TensorInfo& first,
74 std::string
const& descName,
75 std::string
const& firstName,
76 std::string
const& secondName)
81 + firstName +
" & " + secondName +
" must have identical shapes");
86 void ValidateNumInputs(
const WorkloadInfo& workloadInfo, std::string
const& descName,
const unsigned int expectedSize)
91 ": Requires exactly " + to_string(expectedSize) +
"input(s). " +
97 void ValidateNumOutputs(
const WorkloadInfo& workloadInfo, std::string
const& descName,
const unsigned int expectedSize)
102 ": Requires exactly " + to_string(expectedSize) +
" output(s). " +
110 void ValidateTensorNumElements(
const TensorInfo& tensor,
111 std::string
const& descName,
112 unsigned int numElements,
113 std::string
const& tensorName)
119 tensorName +
" tensor.");
125 const std::string& descName, std::string
const& tensorName)
134 void ValidPerAxisQuantizedDataType(
const TensorInfo& tensor,
const std::string& descName,
const std::string& tensorName)
139 ": Expected data type which supports per-axis quantization scheme but got " +
145 void ValidateTensorQuantizationSpace(
const TensorInfo& first,
147 const std::string& descName,
148 std::string
const& firstName,
149 std::string
const& secondName)
161 if (firstDataType != secondDataType)
164 " must be of the same quantized type, " +
172 " must have the same quantization space, " +
181 void ValidateBiasTensorQuantization(
const TensorInfo& biasTensor,
183 const std::string& descName)
197 if (weightScales.size() != biasScales.size())
199 std::stringstream msg;
200 msg << descName <<
": Expected matching number of per-axis quantization scales for weights and bias, "
201 <<
"but got different values. This is currently unsupported: weights=" << weightScales.size()
202 <<
", biases=" << biasScales.size();
209 void ValidateTensors(
const std::vector<ITensorHandle*>& vec,
210 unsigned int numExpected,
211 const std::string& descName,
212 const std::string& varName)
214 if (vec.empty() && numExpected > 0)
219 for (
unsigned int i = 0; i < numExpected; ++i)
229 void ValidateBroadcastTensorShapesMatch(
const TensorInfo& first,
232 std::string
const& descName,
233 std::string
const& firstName,
234 std::string
const& secondName)
241 + firstName +
" & " + secondName
242 +
" must have the same number of dimensions in order to be broadcasted");
245 std::vector<uint32_t> outputDims(numDims, 0u);
246 for (uint32_t i = 0; i < numDims; i++)
249 const bool dimsNotOne = (first.
GetShape()[i] != 1) && (second.
GetShape()[i] != 1);
250 if (dimsNotEqual && dimsNotOne)
256 TensorShape broadcastShape =
TensorShape(armnn::numeric_cast<unsigned int>(outputDims.size()), outputDims.data());
257 if (broadcastShape != output.
GetShape())
260 + firstName +
" & " + secondName
261 +
" does not match the output shape");
266 void ValidateDataTypes(
const TensorInfo& info,
267 const std::vector<armnn::DataType>& supportedTypes,
268 std::string
const& descName)
270 auto iterator = std::find(supportedTypes.begin(), supportedTypes.end(),
info.GetDataType());
271 if (iterator == supportedTypes.end())
278 void ValidateTensorDataTypesMatch(
const TensorInfo& first,
280 std::string
const& descName,
281 std::string
const& firstName,
282 std::string
const& secondName)
287 " must have identical data types.");
292 void ValidateTensorNumElementsMatch(
const TensorInfo& first,
294 std::string
const& descName,
295 std::string
const& firstName,
296 std::string
const& secondName)
301 " must have the same number of elements.");
305 void ValidateWeightDataType(
const TensorInfo& inputInfo,
307 const std::string& descName)
312 const std::vector<DataType> validTypes =
319 ValidateDataTypes(weightInfo, validTypes, descName);
323 ValidateTensorDataTypesMatch(inputInfo, weightInfo, descName,
"input",
"weight");
327 void ValidatePerAxisQuantizationDimension(
const TensorInfo& tensorInfo,
328 const std::string& descName,
329 const std::string& tensorName)
335 "not set on tensor {1}.", descName, tensorName));
339 void ValidatePerAxisQuantizationOffset(
const TensorInfo& tensorInfo,
340 const std::string& descName,
341 const std::string& tensorName)
344 if (quantizationOffset != 0)
347 "{0}: Quantization offset for per-axis quantization expected to be 0 on tensor {1}, but got: {2}",
348 descName, tensorName, quantizationOffset));
352 void ValidatePerAxisQuantization(
const TensorInfo& inputInfo,
356 const std::string& descName)
363 const bool canHavePerAxisQuantization = (
IsQuantized8BitType(inputDataType)) && inputDataType == outputDataType;
365 if (!canHavePerAxisQuantization)
368 "{0}: Per-axis quantization parameters set on tensor {1}, but data type does not support "
369 "per-axis quantization.", descName,
"weight"));
373 ValidPerAxisQuantizedDataType(weightInfo, descName,
"weight");
374 ValidatePerAxisQuantizationDimension(weightInfo, descName,
"weight");
375 ValidatePerAxisQuantizationOffset(weightInfo, descName,
"weight");
383 "{}: Per-axis quantization parameters not set on bias tensor, "
384 "despite being set on weight tensor.", descName));
387 ValidateTensorDataType(biasInfo, DataType::Signed32, descName,
"bias");
388 ValidatePerAxisQuantizationDimension(biasInfo, descName,
"bias");
389 ValidatePerAxisQuantizationOffset(biasInfo, descName,
"bias");
398 std::string
const& descName,
399 unsigned int numDimensions,
400 std::string
const& tensorName)
const
407 unsigned int squeezedDims = 0;
416 if (tensor.
GetNumDimensions() < numDimensions || squeezedDims > numDimensions)
420 tensorName +
" tensor.");
429 tensorName +
" tensor.");
436 unsigned int numDimension,
437 unsigned int numElements,
438 std::string
const& tensorName)
const
440 const std::string functionName{
"ValidateTensorNumDimNumElem"};
442 ValidateTensorNumElements(tensorInfo, functionName, numElements, tensorName);
447 unsigned int numExpectedIn,
unsigned int numExpectedOut)
const
449 ValidateTensors(
m_Inputs, numExpectedIn, descName,
"input");
450 ValidateTensors(
m_Outputs, numExpectedOut, descName,
"output");
456 const std::string descriptorName{
"MapQueueDescriptor"};
458 ValidateNumInputs(workloadInfo, descriptorName, 1);
459 ValidateNumOutputs(workloadInfo, descriptorName, 0);
461 for (
unsigned int i = 0; i <
m_Inputs.size(); ++i)
466 fmt::format(
"{}: Invalid NULL input {}.", descriptorName,
static_cast<int>(i)));
474 const std::string descriptorName{
"UnmapQueueDescriptor"};
476 ValidateNumInputs(workloadInfo, descriptorName, 1);
477 ValidateNumOutputs(workloadInfo, descriptorName, 0);
479 for (
unsigned int i = 0; i <
m_Inputs.size(); ++i)
484 fmt::format(
"{}: Invalid NULL input {}.", descriptorName,
static_cast<int>(i)));
492 const std::string descriptorName{
"MemCopyQueueDescriptor"};
494 ValidateNumInputs(workloadInfo, descriptorName, 1);
495 ValidateNumOutputs(workloadInfo, descriptorName , 1);
500 ValidateTensorNumElementsMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
501 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
506 "{0}: Number of inputs ({1}) does not match the number of outputs ({2}).",
510 for (
unsigned int i = 0; i <
m_Inputs.size(); ++i)
515 "{0}: Invalid NULL input {1}.", descriptorName, i));
528 ValidateNumInputs(workloadInfo,
"MemImportQueueDescriptor", 1);
529 ValidateNumOutputs(workloadInfo,
"MemImportQueueDescriptor" , 1);
541 "Number of input infos ({0}) does not match the number of output infos ({1})",
551 "Number of elements for tensor input and output {} does not match", i ));
563 "Number of inputs ({0}) does not match the number of outputs ({1})",
567 for (
unsigned int i = 0; i <
m_Inputs.size(); ++i)
584 ValidateNumInputs(workloadInfo,
"MemSyncQueueDescriptor", 1);
605 const std::string descriptorName{
"ActivationQueueDescriptor"};
607 ValidateNumInputs(workloadInfo, descriptorName, 1);
608 ValidateNumOutputs(workloadInfo, descriptorName, 1);
613 std::vector<DataType> supportedTypes =
623 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
624 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
625 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
630 const std::string descriptorName{
"ArgMinMaxQueueDescriptor"};
632 ValidateNumInputs(workloadInfo, descriptorName, 1);
633 ValidateNumOutputs(workloadInfo, descriptorName, 1);
644 std::vector<DataType> supportedInputTypes =
656 ValidateDataTypes(inputTensorInfo, supportedInputTypes, descriptorName);
658 auto inputShape = inputTensorInfo.
GetShape();
659 auto outputShape = outputTensorInfo.
GetShape();
664 const std::string outputShapeError{
": Output tensor shape does not match shape inferred from input tensor."};
667 if (inputShape.GetNumDimensions() == 1)
669 if (outputShape.GetNumDimensions() != 1 && outputShape[0] != 1)
676 for (
unsigned int i = 0; i < unsignedAxis; ++i)
678 if (outputShape[i] != inputShape[i])
684 for (
auto i = unsignedAxis + 1; i < inputNumDimensions; ++i)
686 if (outputShape[i - 1] != inputShape[i])
696 const std::string descriptorName{
"CastQueueDescriptor"};
698 ValidateNumInputs(workloadInfo, descriptorName, 1);
699 ValidateNumOutputs(workloadInfo, descriptorName, 1);
704 std::vector<DataType> supportedTypes =
717 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
718 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
723 const std::string descriptorName{
"SoftmaxQueueDescriptor"};
725 ValidateNumInputs(workloadInfo, descriptorName, 1);
726 ValidateNumOutputs(workloadInfo, descriptorName, 1);
731 std::vector<DataType> supportedTypes =
741 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
742 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
743 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
748 const std::string descriptorName{
"SplitterQueueDescriptor"};
750 ValidateNumInputs(workloadInfo, descriptorName, 1);
753 std::vector<DataType> supportedTypes =
769 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
771 const std::string outputName =
"output_" + std::to_string(i);
772 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input", outputName);
783 descriptorName +
": Number of split windows "
784 "has to match number of workloadInfo.m_OutputTensorInfos. "
785 "Number of windows: " +
787 ". Number of workloadInfo.m_OutputTensorInfos: " + to_string(workloadInfo.
m_OutputTensorInfos.size()));
799 "have the same dimensionality as the input tensor. "
800 "Window origin (index: " +
801 to_string(w) +
") has " + to_string(e.
m_Origin.size()) +
802 " dimensions, the input "
804 to_string(inputDims) +
" dimensions.");
806 for (
unsigned int i = 0; i < e.
m_Origin.size(); ++i)
812 "be smaller or equal than the size of the input in that coord.");
820 const std::string descriptorName{
"ConcatQueueDescriptor"};
822 ValidateNumOutputs(workloadInfo, descriptorName, 1);
855 descriptorName +
": Number of split windows "
856 "has to match number of workloadInfo.m_InputTensorInfos. "
857 "Number of windows: " +
859 ". Number of workloadInfo.m_InputTensorInfos: " + to_string(workloadInfo.
m_InputTensorInfos.size()));
868 if (e.
m_Origin.size() != outputDims)
871 "have the same dimensionality as the output tensor. "
872 "Window origin (index: " +
873 to_string(w) +
") has " + to_string(e.
m_Origin.size()) +
874 " dimensions, the output "
876 to_string(outputDims) +
" dimensions.");
879 for (
unsigned int i = 0; i < e.
m_Origin.size(); ++i)
885 "be smaller or equal than the size of the output in that coord.");
891 std::vector<DataType> supportedTypes =
907 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
909 const std::string inputName =
"input_" + std::to_string(i);
910 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName, inputName,
"output");
916 const std::string descriptorName{
"StackQueueDescriptor"};
918 ValidateNumOutputs(workloadInfo, descriptorName, 1);
945 "than the number of input dimensions.");
952 if (outputShape[i] != inputShape[i])
955 "match shape inferred from input tensor.");
962 "match shape inferred from input tensor.");
967 if (outputShape[i] != inputShape[i-1])
970 "match shape inferred from input tensor.");
980 std::vector<DataType> supportedTypes =
992 ValidateDataTypes(workloadInfo.
m_InputTensorInfos[0], supportedTypes, descriptorName);
1000 "input_" + std::to_string(i));
1012 const std::string descriptorName{
"FillQueueDescriptor"};
1014 ValidateNumInputs(workloadInfo, descriptorName, 1);
1015 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1022 std::vector<DataType> supportedTypes =
1030 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1035 const std::string descriptorName{
"FullyConnectedQueueDescriptor"};
1037 uint32_t numInputs = 2;
1043 ValidateNumInputs(workloadInfo, descriptorName, numInputs);
1044 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1063 ValidateBiasTensorQuantization(biasTensorInfo, weightTensorInfo, descriptorName);
1069 std::vector<DataType> supportedTypes =
1079 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1087 "for BFloat16 input.");
1092 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1103 const std::string descriptorName{
"NormalizationQueueDescriptor"};
1105 ValidateNumInputs(workloadInfo, descriptorName, 1);
1106 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1112 std::vector<DataType> supportedTypes =
1122 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1124 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1126 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1131 const std::string descriptorName{
"AdditionQueueDescriptor"};
1133 ValidateNumInputs(workloadInfo, descriptorName, 2);
1134 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1140 std::vector<DataType> supportedTypes =
1151 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
1152 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
1153 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1155 ValidateTensorDataTypesMatch(inputTensorInfo0, inputTensorInfo1, descriptorName,
"input_0",
"input_1");
1156 ValidateTensorDataTypesMatch(inputTensorInfo1, outputTensorInfo, descriptorName,
"input_1",
"output");
1158 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
1168 const std::string descriptorName{
"MultiplicationQueueDescriptor"};
1170 ValidateNumInputs(workloadInfo, descriptorName, 2);
1171 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1177 std::vector<DataType> supportedTypes =
1188 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
1189 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
1190 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1192 ValidateTensorDataTypesMatch(inputTensorInfo0, inputTensorInfo1, descriptorName,
"input_0",
"input_1");
1193 ValidateTensorDataTypesMatch(inputTensorInfo1, outputTensorInfo, descriptorName,
"input_1",
"output");
1195 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
1205 const std::string descriptorName{
"BatchNormalizationQueueDescriptor"};
1207 ValidateNumInputs(workloadInfo, descriptorName, 1);
1208 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1213 std::vector<DataType> supportedTypes =
1223 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1224 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1226 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1227 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1229 ValidatePointer(
m_Mean, descriptorName,
"mean");
1230 ValidatePointer(
m_Variance, descriptorName,
"variance");
1231 ValidatePointer(
m_Beta, descriptorName,
"beta");
1232 ValidatePointer(
m_Gamma, descriptorName,
"gamma");
1244 ValidateTensorShapesMatch(mean, variance, descriptorName,
"mean",
"variance");
1245 ValidateTensorShapesMatch(mean, beta, descriptorName,
"mean",
"beta");
1246 ValidateTensorShapesMatch(mean, gamma, descriptorName,
"mean",
"gamma");
1251 const std::string descriptorName{
"Convolution2dQueueDescriptor"};
1253 uint32_t numInputs = 2;
1259 ValidateNumInputs(workloadInfo, descriptorName, numInputs);
1260 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1272 ValidateWeightDataType(inputTensorInfo, weightTensorInfo, descriptorName);
1277 optionalBiasTensorInfo = MakeOptional<TensorInfo>(workloadInfo.
m_InputTensorInfos[2]);
1281 ValidateBiasTensorQuantization(biasTensorInfo, weightTensorInfo, descriptorName);
1287 fmt::format(
"{}: strideX (provided {}) and strideY (provided {}) "
1288 "cannot be either negative or 0.",
1292 ValidatePerAxisQuantization(inputTensorInfo,
1295 optionalBiasTensorInfo,
1298 std::vector<DataType> supportedTypes =
1309 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1317 "for BFloat16 input.");
1322 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1328 const std::string descriptorName{
"Convolution3dQueueDescriptor"};
1330 uint32_t numInputs = 2;
1335 ValidateNumInputs(workloadInfo, descriptorName, numInputs);
1336 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1347 ValidateWeightDataType(inputTensorInfo, weightTensorInfo, descriptorName);
1352 optionalBiasTensorInfo = MakeOptional<TensorInfo>(workloadInfo.
m_InputTensorInfos[2]);
1356 ValidateBiasTensorQuantization(biasTensorInfo, weightTensorInfo, descriptorName);
1362 fmt::format(
"{}: strideX (provided {}), strideY (provided {}) or strideZ (provided {})"
1363 "cannot be either negative or 0.",
1367 ValidatePerAxisQuantization(inputTensorInfo,
1370 optionalBiasTensorInfo,
1373 std::vector<DataType> supportedTypes =
1384 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1385 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1390 const std::string descriptorName{
"DepthwiseConvolution2dQueueDescriptor"};
1392 uint32_t numInputs = 2;
1398 ValidateNumInputs(workloadInfo, descriptorName, numInputs);
1399 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1413 fmt::format(
"{}: dilationX (provided {}) and dilationY (provided {}) "
1414 "cannot be smaller than 1.",
1421 fmt::format(
"{}: strideX (provided {}) and strideY (provided {}) "
1422 "cannot be either negative or 0.",
1426 if (weightTensorInfo.
GetShape()[0] != 1)
1429 "{0}: The weight format in armnn is expected to be [1, H, W, Cout]."
1430 "But first dimension is not equal to 1. Provided weight shape: [{1}, {2}, {3}, {4}]",
1439 const unsigned int numWeightOutputChannelsRefFormat = weightTensorInfo.
GetShape()[3];
1440 const unsigned int numWeightOutputChannelsAclFormat = weightTensorInfo.
GetShape()[1];
1441 const unsigned int numOutputChannels = outputTensorInfo.
GetShape()[channelIndex];
1444 bool validRefFormat = (numWeightOutputChannelsRefFormat == numOutputChannels);
1445 bool validAclFormat = (numWeightOutputChannelsAclFormat == numOutputChannels);
1447 if (!(validRefFormat || validAclFormat))
1450 "{0}: The weight format in armnn is expected to be [1, H, W, Cout] (CpuRef) or [1, Cout, H, W] "
1451 "(CpuAcc/GpuAcc). But neither the 4th (CpuRef) or 2nd (CpuAcc/GpuAcc) dimension is equal to Cout."
1452 "Cout = {1} Provided weight shape: [{2}, {3}, {4}, {5}]",
1461 ValidateWeightDataType(inputTensorInfo, weightTensorInfo, descriptorName);
1466 optionalBiasTensorInfo = MakeOptional<TensorInfo>(workloadInfo.
m_InputTensorInfos[2]);
1469 ValidateBiasTensorQuantization(biasTensorInfo, weightTensorInfo, descriptorName);
1472 ValidatePerAxisQuantization(inputTensorInfo,
1475 optionalBiasTensorInfo,
1478 std::vector<DataType> supportedTypes =
1488 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1489 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1494 const std::string descriptorName{
"PermuteQueueDescriptor"};
1496 ValidateNumInputs(workloadInfo, descriptorName, 1);
1497 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1507 for (
unsigned int i = 0u; i < mapping.
GetSize(); ++i)
1509 if (inputTensorInfo.
GetShape()[i] != outputTensorInfo.
GetShape()[mapping[i]])
1512 " (=" + to_string(inputTensorInfo.
GetShape()[i]) +
") " +
1513 "must match dst dimension " + to_string(mapping[i]) +
1514 " (=" + to_string(outputTensorInfo.
GetShape()[mapping[i]]) +
")");
1518 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1523 const std::string descriptorName{
"Pooling2dQueueDescriptor"};
1525 ValidateNumInputs(workloadInfo, descriptorName, 1);
1526 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1534 std::vector<DataType> supportedTypes =
1544 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1545 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1550 const std::string descriptorName{
"Pooling3dQueueDescriptor"};
1552 ValidateNumInputs(workloadInfo, descriptorName, 1);
1553 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1561 std::vector<DataType> supportedTypes =
1571 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1572 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1577 const std::string descriptorName{
"ResizeQueueDescriptor"};
1579 ValidateNumInputs(workloadInfo, descriptorName, 1);
1580 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1588 std::vector<DataType> supportedTypes =
1598 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1599 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1602 const unsigned int inputBatchSize = inputTensorInfo.
GetShape()[0];
1603 const unsigned int outputBatchSize = outputTensorInfo.
GetShape()[0];
1604 if (inputBatchSize != outputBatchSize)
1607 fmt::format(
"{}: Input batch size ({}) does not match output batch size ({})",
1608 descriptorName, inputBatchSize, outputBatchSize));
1614 if (inputChannelCount != outputChannelCount)
1617 fmt::format(
"{}: Input channel count ({}) does not match output channel count ({})",
1618 descriptorName, inputChannelCount, outputChannelCount));
1624 const std::string descriptorName{
"ReverseV2QueueDescriptor"};
1627 const unsigned int maxDimensions = 4;
1629 ValidateNumInputs(workloadInfo, descriptorName, 2);
1630 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1637 if (inputTensorNumDimensions > maxDimensions)
1640 ": Input tensors with rank greater than " +
1641 std::to_string(maxDimensions) +
" are not supported.");
1645 if (axisTensorNumDimensions > maxDimensions)
1648 ": More than " + std::to_string(maxDimensions) +
" axes cannot be specified.");
1651 if (axisTensorNumDimensions > inputTensorNumDimensions)
1654 ": More axes specified than the number of axes on the input tensor.");
1657 std::vector<DataType> supportedTypes =
1669 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1671 std::vector<DataType> axisSupportedTypes =
1676 ValidateDataTypes(axisTensorInfo, axisSupportedTypes, descriptorName);
1678 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1679 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1684 const std::string descriptorName{
"FakeQuantizationQueueDescriptor"};
1686 ValidateNumInputs(workloadInfo, descriptorName, 1);
1687 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1695 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1705 const std::string descriptorName{
"InstanceNormalizationQueueDescriptor"};
1707 ValidateNumInputs(workloadInfo, descriptorName, 1);
1708 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1718 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1721 std::vector<DataType> supportedTypes =
1728 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1729 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1734 const std::string descriptorName{
"L2NormalizationQueueDescriptor"};
1736 ValidateNumInputs(workloadInfo, descriptorName, 1);
1737 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1747 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1750 std::vector<DataType> supportedTypes =
1760 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1761 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1766 const std::string descriptorName{
"LogSoftmaxQueueDescriptor"};
1768 ValidateNumInputs(workloadInfo, descriptorName, 1);
1769 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1774 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1776 std::vector<DataType> supportedTypes =
1783 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1784 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1789 const std::string descriptorName{
"ConstantQueueDescriptor"};
1791 ValidateNumInputs(workloadInfo, descriptorName, 0);
1792 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1803 std::vector<DataType> supportedTypes =
1815 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1820 const std::string descriptorName{
"ReshapeQueueDescriptor"};
1822 ValidateNumInputs(workloadInfo, descriptorName, 1);
1823 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1828 ValidateTensorNumElementsMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1831 std::vector<DataType> supportedTypes =
1843 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1844 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1849 const std::string descriptorName{
"SpaceToBatchNdQueueDescriptor"};
1851 ValidateNumInputs(workloadInfo, descriptorName, 1);
1852 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1860 "dimensions as Block Shape.");
1882 const unsigned int inputWidth = (inputTensorInfo.
GetNumDimensions() == 3) ? 1 :
1887 const unsigned int channelsIndex = channelsIndex_int < 0 ?
1888 static_cast<unsigned int>(channelsIndex_int) + inputTensorInfo.
GetNumDimensions()
1889 :
static_cast<unsigned int>(channelsIndex_int);
1891 const unsigned int numInputElements = inputTensorInfo.
GetShape()[0] *
1894 inputTensorInfo.
GetShape()[channelsIndex];
1899 to_string(numInputElements) +
" after padding but output tensor has " +
1908 unsigned int spatialDimension = firstSpatialDimension + i;
1909 auto inputSize = inputTensorInfo.
GetShape()[spatialDimension] +
1915 "divisible by Block Shape in dimension: " + to_string(spatialDimension) +
".");
1919 std::vector<DataType> supportedTypes =
1929 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1930 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1935 const std::string descriptorName{
"SpaceToDepthQueueDescriptor"};
1937 ValidateNumInputs(workloadInfo, descriptorName, 1);
1938 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1946 std::vector<DataType> supportedTypes =
1956 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1957 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1959 ValidateTensorNumElementsMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1967 const unsigned int wIndex = dimensionIndices.
GetWidthIndex();
1975 "by block size in all spatial dimensions");
1982 "must be divisible by the square of block size." );
1988 const std::string descriptorName{
"FloorQueueDescriptor"};
1990 ValidateNumInputs(workloadInfo, descriptorName, 1);
1991 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1996 std::vector<DataType> supportedTypes =
2004 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2005 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2006 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2007 ValidateTensorQuantizationSpace(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2014 const std::string descriptorName{
"LstmQueueDescriptor"};
2026 std::vector<DataType> supportedTypes =
2035 ValidateDataTypes(workloadInfo.
m_InputTensorInfos[0], supportedTypes, descriptorName);
2044 "input_" + std::to_string(i));
2051 "LstmQueueDescriptor",
2053 "output_" + std::to_string(i));
2078 descriptorName +
" input_0");
2081 descriptorName +
" input_1");
2084 descriptorName +
" input_2");
2088 descriptorName +
" output_0");
2091 descriptorName +
" output_1");
2094 descriptorName +
" output_2");
2097 descriptorName +
" output_3");
2103 (n_cell * n_input),
"InputLayerNormWeights");
2108 (n_cell * n_input),
"InputToForgetWeights");
2112 (n_cell * n_input),
"InputToCellWeights");
2117 (n_cell * n_output),
"RecurrentToInputWeights");
2122 (n_cell * n_output),
"RecurrentToForgetWeights");
2126 (n_cell * n_output),
"RecurrentToCellWeights");
2134 if (!cifg_weights_all_or_none)
2137 "RecurrentToInputWeights must either both be present (regular LSTM) "
2138 "or both not present (CIFG-LSTM). In addition CifgEnable must be set "
2145 n_cell,
"CellToInputWeights");
2150 n_cell,
"CellToForgetWeights");
2155 n_cell,
"CellToOutputWeights");
2159 bool peephole_weights_all_or_none =
2164 if (!peephole_weights_all_or_none)
2182 "must be present.");
2185 n_cell,
"InputGateBias");
2191 ValidatePointer(
m_CellBias,
"Null pointer check",
"CellBias");
2200 (n_cell * n_output),
"ProjectionWeights");
2217 if (!projecton_tensors_consistent)
2250 "disabled but InputLayerNormWeights are not present");
2253 1, n_cell,
"InputLayerNormWeights");
2262 "ForgetLayerNormWeights");
2266 "OutputLayerNormWeights");
2270 "CellLayerNormWeights");
2276 "normalisation weights are present.");
2282 const std::string descriptorName{
"ConvertFp32ToFp16QueueDescriptor"};
2284 ValidateNumInputs(workloadInfo, descriptorName, 1);
2285 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2300 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2305 const std::string descriptorName{
"ConvertFp16ToFp32QueueDescriptor"};
2307 ValidateNumInputs(workloadInfo, descriptorName, 1);
2308 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2323 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2328 const std::string descriptorName{
"DivisionQueueDescriptor"};
2330 ValidateNumInputs(workloadInfo, descriptorName, 2);
2331 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2337 std::vector<DataType> supportedTypes =
2348 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2349 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2350 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
2352 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2362 const std::string descriptorName{
"SubtractionQueueDescriptor"};
2364 ValidateNumInputs(workloadInfo, descriptorName, 2);
2365 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2371 std::vector<DataType> supportedTypes =
2382 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2383 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2384 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
2386 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2396 const std::string descriptorName{
"MaximumQueueDescriptor"};
2398 ValidateNumInputs(workloadInfo, descriptorName, 2);
2399 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2405 std::vector<DataType> supportedTypes =
2416 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2417 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2418 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
2420 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2430 const std::string descriptorName{
"MeanQueueDescriptor"};
2432 ValidateNumInputs(workloadInfo, descriptorName, 1);
2433 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2438 std::vector<DataType> supportedTypes =
2450 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2451 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2463 unsigned int outputDim =
2467 outputDim > 0 ? outputDim : 1,
2474 const std::string descriptorName{
"PadQueueDescriptor"};
2476 ValidateNumInputs(workloadInfo, descriptorName, 1);
2477 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2488 "as there are dimensions in the input tensor that is " +
2496 const std::string descriptorName{
"QuantizeQueueDescriptor"};
2498 ValidateNumInputs(workloadInfo, descriptorName, 1);
2499 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2504 std::vector<DataType> supportedTypes =
2515 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2525 const std::string descriptorName{
"BatchToSpaceNdQueueDescriptor"};
2527 ValidateNumInputs(workloadInfo, descriptorName, 1);
2528 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2536 "dimensions as Block Shape.");
2559 unsigned int spatialDimension = firstSpatialDimension + i;
2562 if (cropSize > outputSize)
2565 "outputSize in dimension: " + to_string(spatialDimension) +
".");
2569 std::vector<DataType> supportedTypes =
2579 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2580 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2585 const std::string descriptorName{
"StridedSliceQueueDescriptor"};
2587 ValidateNumInputs(workloadInfo, descriptorName, 1);
2588 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2593 std::vector<DataType> supportedTypes =
2603 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2604 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2606 ValidateTensorQuantizationSpace(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2642 const std::string descriptorName{
"MinimumQueueDescriptor"};
2644 ValidateNumInputs(workloadInfo, descriptorName, 2);
2645 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2651 std::vector<DataType> supportedTypes =
2662 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2663 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2664 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
2666 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2676 const std::string descriptorName{
"DebugQueueDescriptor"};
2678 ValidateNumInputs(workloadInfo, descriptorName, 1);
2679 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2684 const std::string descriptorName{
"EqualQueueDescriptor"};
2686 ValidateNumInputs(workloadInfo, descriptorName, 2);
2687 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2693 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2708 const std::string descriptorName{
"GreaterQueueDescriptor"};
2710 ValidateNumInputs(workloadInfo, descriptorName, 2);
2711 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2717 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2732 const std::string descriptorName{
"RsqrtQueueDescriptor"};
2734 ValidateNumInputs(workloadInfo, descriptorName, 1);
2735 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2740 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2742 std::vector<DataType> supportedTypes =
2752 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2753 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2758 const std::string descriptorName{
"GatherNdQueueDescriptor"};
2760 ValidateNumInputs(workloadInfo, descriptorName, 2);
2761 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2772 std::vector<DataType> supportedTypes =
2783 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2785 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2793 const std::string descriptorName{
"GatherQueueDescriptor"};
2795 ValidateNumInputs(workloadInfo, descriptorName, 2);
2796 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2807 std::vector<DataType> supportedTypes =
2818 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2820 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2828 const std::string& descriptorName{
"DetectionPostProcessQueueDescriptor"};
2830 ValidateNumInputs(workloadInfo, descriptorName, 2);
2856 const std::vector<DataType> supportedInputTypes =
2866 ValidateDataTypes(boxEncodingsInfo, supportedInputTypes, descriptorName);
2867 ValidateDataTypes(scoresInfo, supportedInputTypes, descriptorName);
2868 ValidateDataTypes(anchorsInfo, supportedInputTypes, descriptorName);
2876 ValidateTensorDataType(detectionBoxesInfo,
DataType::Float32, descriptorName,
"detection boxes");
2877 ValidateTensorDataType(detectionScoresInfo,
DataType::Float32, descriptorName,
"detection scores");
2878 ValidateTensorDataType(detectionClassesInfo,
DataType::Float32, descriptorName,
"detection classes");
2879 ValidateTensorDataType(numDetectionsInfo,
DataType::Float32, descriptorName,
"num detections");
2884 "must be positive and less than or equal to 1.");
2890 "should be equal to number of classes + 1.");
2896 const std::string& descriptorName{
"DequantizeQueueDescriptor"};
2898 ValidateNumInputs(workloadInfo, descriptorName, 1);
2899 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2904 std::vector<DataType> inputSupportedTypes =
2912 ValidateDataTypes(inputTensorInfo, inputSupportedTypes, descriptorName);
2914 std::vector<DataType> outputSupportedTypes =
2921 ValidateDataTypes(outputTensorInfo, outputSupportedTypes, descriptorName);
2926 const std::string& descriptorName{
"MergeQueueDescriptor"};
2928 ValidateNumInputs(workloadInfo, descriptorName, 2);
2929 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2935 ValidateTensorShapesMatch(inputTensorInfo0, inputTensorInfo1, descriptorName,
"input_0",
"input_1");
2936 ValidateTensorShapesMatch(inputTensorInfo0, outputTensorInfo, descriptorName,
"input_0",
"output");
2938 ValidateTensorDataTypesMatch(inputTensorInfo0, inputTensorInfo1, descriptorName,
"input_0",
"input_1");
2939 ValidateTensorDataTypesMatch(inputTensorInfo0, outputTensorInfo, descriptorName,
"input_0",
"output");
2944 const std::string& descriptorName{
"ShapeQueueDescriptor"};
2946 ValidateNumInputs(workloadInfo, descriptorName, 1);
2947 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2952 std::vector<DataType> supportedTypes =
2964 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2970 const std::string& descriptorName{
"SwitchQueueDescriptor"};
2972 ValidateNumInputs(workloadInfo, descriptorName, 2);
2973 ValidateNumOutputs(workloadInfo, descriptorName, 2);
2981 std::vector<DataType> supportedTypes =
2990 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2991 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2993 ValidateDataTypes(outputTensorInfo0, supportedTypes, descriptorName);
2994 ValidateDataTypes(outputTensorInfo1, supportedTypes, descriptorName);
2996 ValidateTensorShapesMatch(inputTensorInfo0,
3002 ValidateTensorShapesMatch(inputTensorInfo0,
3016 const std::string& descriptorName{
"PreluQueueDescriptor"};
3018 ValidateNumInputs(workloadInfo, descriptorName, 2);
3019 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3025 std::vector<DataType> supportedTypes
3035 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3036 ValidateDataTypes(alphaTensorInfo, supportedTypes, descriptorName);
3038 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
3040 ValidateTensorDataTypesMatch(inputTensorInfo, alphaTensorInfo, descriptorName,
"input",
"alpha");
3041 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"ouptut");
3043 ValidateBroadcastTensorShapesMatch(inputTensorInfo,
3053 const std::string descriptorName{
"TransposeConvolution2dQueueDescriptor"};
3055 ValidateNumInputs(workloadInfo, descriptorName, 1);
3056 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3064 ValidatePointer(
m_Weight, descriptorName,
"weight");
3069 ValidateWeightDataType(inputTensorInfo, weightTensorInfo, descriptorName);
3074 ValidatePointer(
m_Bias, descriptorName,
"bias");
3080 ValidateBiasTensorQuantization(biasTensorInfo, weightTensorInfo, descriptorName);
3083 ValidatePerAxisQuantization(inputTensorInfo,
3086 optionalBiasTensorInfo,
3089 std::vector<DataType> supportedTypes =
3099 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3100 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3105 const std::string descriptorName{
"TransposeQueueDescriptor"};
3107 ValidateNumInputs(workloadInfo, descriptorName, 1);
3108 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3118 for (
unsigned int i = 0u; i < mapping.
GetSize(); ++i)
3120 if (inputTensorInfo.
GetShape()[mapping[i]] != outputTensorInfo.
GetShape()[i])
3123 " (=" + to_string(inputTensorInfo.
GetShape()[mapping[i]]) +
") " +
3124 "must match dst dimension " + to_string(i) +
3125 " (=" + to_string(outputTensorInfo.
GetShape()[i]) +
")");
3129 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3134 const std::string descriptorName{
"TransposeQueueDescriptor"};
3136 ValidateNumInputs(workloadInfo, descriptorName, 1);
3137 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3142 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3147 const std::string descriptorName{
"QLstmQueueDescriptor"};
3150 ValidateNumInputs(workloadInfo, descriptorName, 3);
3151 ValidateNumOutputs(workloadInfo, descriptorName, 3);
3163 std::vector<DataType> inputOutputSupportedTypes =
3168 std::vector<DataType> cellStateSupportedTypes =
3173 std::vector<DataType> weightsSupportedTypes =
3178 std::vector<DataType> layerNormPeepholeWeightsSupportedTypes =
3183 std::vector<DataType> biasSupportedTypes =
3189 ValidateDataTypes(inputInfo, inputOutputSupportedTypes, descriptorName);
3190 ValidateDataTypes(outputStateInInfo, inputOutputSupportedTypes, descriptorName);
3191 ValidateDataTypes(cellStateInInfo, cellStateSupportedTypes, descriptorName);
3193 ValidateDataTypes(outputStateOutInfo, inputOutputSupportedTypes, descriptorName);
3194 ValidateDataTypes(cellStateOutInfo, cellStateSupportedTypes, descriptorName);
3195 ValidateDataTypes(outputInfo, inputOutputSupportedTypes, descriptorName);
3198 ValidateTensorDataTypesMatch(inputInfo, outputStateInInfo, descriptorName,
"input",
"outputStateIn");
3199 ValidateTensorDataTypesMatch(outputStateInInfo, outputStateOutInfo, descriptorName,
3200 "outputStateIn",
"outputStateOut");
3201 ValidateTensorDataTypesMatch(cellStateInInfo, cellStateOutInfo, descriptorName,
"cellStateIn",
"cellStateOut");
3204 const uint32_t numBatches = inputInfo.
GetShape()[0];
3205 const uint32_t inputSize = inputInfo.
GetShape()[1];
3206 const uint32_t outputSize = outputStateInInfo.GetShape()[1];
3207 const uint32_t numUnits = cellStateInInfo.GetShape()[1];
3234 " RecurrentToForgetWeights");
3245 ValidateDataTypes(inputToForgetWeightsInfo, weightsSupportedTypes, descriptorName);
3247 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, inputToCellWeightsInfo, descriptorName,
3248 "inputToForgetWeights",
"inputToCellWeights");
3249 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, inputToOutputWeightsInfo, descriptorName,
3250 "inputToForgetWeights",
"inputToOutputWeights");
3252 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, recurrentToForgetWeightsInfo, descriptorName,
3253 "inputToForgetWeights",
"recurrentToForgeteights");
3254 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, recurrentToCellWeightsInfo, descriptorName,
3255 "inputToForgetWeights",
"recurrentToCellWeights");
3256 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, recurrentToOutputWeightsInfo, descriptorName,
3257 "inputToForgetWeights",
"recurrentToOutputWeights");
3264 ValidatePointer(
m_CellBias, descriptorName,
"CellBias");
3273 ValidateDataTypes(forgetGateBiasInfo, biasSupportedTypes, descriptorName);
3275 ValidateTensorDataTypesMatch(forgetGateBiasInfo, cellBiasInfo, descriptorName,
3276 "forgetGateBias",
"cellBias");
3277 ValidateTensorDataTypesMatch(forgetGateBiasInfo, outputGateBiasInfo, descriptorName,
3278 "forgetGateBias",
"outputGateBias");
3286 if (!allCifgParamsPresentOrNot)
3289 ": InputToInputWeights, RecurrentToInputWeights and InputGateBias must either all be present "
3290 "(CIFG disabled) or not be present at all (CIFG enabled). m_Parameters.m_CifgEnabled should be "
3291 "set appropriately.");
3302 " RecurrentToInputWeights");
3308 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, inputToInputWeightsInfo, descriptorName,
3309 "inputToForgetWeights",
"inputToInputWeights");
3310 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, recurrentToInputWeightsInfo, descriptorName,
3311 "inputToForgetWeights",
"recurrentToInputWeights");
3312 ValidateTensorDataTypesMatch(forgetGateBiasInfo, inputGateBiasInfo, descriptorName,
3313 "forgetGateBias",
"inputGateBias");
3317 bool allPeepholeWeightsPresentOrNot =
3323 if (!allPeepholeWeightsPresentOrNot)
3326 ": CellToInputWeights, CellToForgetWeights and CellToOutputWeights should all be present (Peephole "
3327 "enabled) or not be present at all (Peephole disabled). CellToInputWeights should only be present "
3328 "when Peephole is enabled and CIFG is disabled. m_Parameters.m_PeepholeEnabled should be set "
3336 ValidateDataTypes(cellToForgetWeightsInfo, layerNormPeepholeWeightsSupportedTypes, descriptorName);
3340 ValidateTensorDataTypesMatch(cellToForgetWeightsInfo, cellToOutputWeightsInfo, descriptorName,
3341 "cellToForgetWeight",
"cellToOutputWeights");
3347 ValidateTensorDataTypesMatch(cellToForgetWeightsInfo, cellToInputWeightsInfo, descriptorName,
3348 "cellToForgetWeights",
"cellToInputWeights");
3353 bool allLayerNormWeightsPresentOrNot =
3359 if (!allLayerNormWeightsPresentOrNot)
3362 ": InputLayerNormWeights, ForgetLayerNormWeights, m_OutputLayerNormWeights "
3363 "and CellLayerNormWeights should all be present (Layer Norm enabled) or not "
3364 "be present at all (Layer Norm disabled). InputLayerNormWeights should "
3365 "only be present when Layer Norm is enabled and CIFG is disabled. "
3366 "m_Parameters.m_LayerNormEnabled should be set appropriately.");
3373 ValidateDataTypes(forgetLayerNormWeightsInfo, layerNormPeepholeWeightsSupportedTypes, descriptorName);
3377 ValidateTensorDataTypesMatch(forgetLayerNormWeightsInfo, cellLayerNormWeightsInfo, descriptorName,
3378 "forgetLayerNormWeights",
"cellLayerNormWeights");
3382 ValidateTensorDataTypesMatch(forgetLayerNormWeightsInfo, outputLayerNormWeightsInfo, descriptorName,
3383 "forgetLayerNormWeights",
"outputLayerNormWeights");
3389 ValidateTensorDataTypesMatch(forgetLayerNormWeightsInfo, inputLayerNormWeightsInfo, descriptorName,
3390 "forgetLayerNormWeights",
"inputLayerNormWeights");
3395 bool correctProjectionTensorsPresent =
3400 if (!correctProjectionTensorsPresent)
3403 ": If projection is enabled, ProjectionWeights should be present and "
3404 "ProjectionBias is optional. If projection is disabled, neither "
3405 "ProjectionWeights nor ProjectionBias should be present.");
3412 ValidateDataTypes(projectionWeightsInfo, weightsSupportedTypes, descriptorName);
3418 ValidateDataTypes(projectionBiasInfo, biasSupportedTypes, descriptorName);
3425 ": If projection is disabled, output quantization info (scale, offset) "
3426 "should match HiddenStateScale and HiddenStateZeroPoint.");
3433 const std::string descriptorName{
"QuantizedLstmQueueDescriptor"};
3436 ValidateNumInputs(workloadInfo, descriptorName, 3);
3437 ValidateNumOutputs(workloadInfo, descriptorName, 2);
3447 std::vector<DataType> inputOutputSupportedTypes =
3452 std::vector<DataType> cellStateSupportedTypes =
3457 std::vector<DataType> weightsSupportedTypes =
3462 std::vector<DataType> biasSupportedTypes =
3468 ValidateDataTypes(inputInfo, inputOutputSupportedTypes, descriptorName);
3469 ValidateDataTypes(cellStateInInfo, cellStateSupportedTypes, descriptorName);
3470 ValidateDataTypes(outputStateInInfo, inputOutputSupportedTypes, descriptorName);
3472 ValidateDataTypes(cellStateOutInfo, cellStateSupportedTypes, descriptorName);
3473 ValidateDataTypes(outputStateOutInfo, inputOutputSupportedTypes, descriptorName);
3476 ValidateTensorDataTypesMatch(inputInfo, outputStateInInfo, descriptorName,
"input",
"outputStateIn");
3477 ValidateTensorDataTypesMatch(outputStateInInfo, outputStateOutInfo, descriptorName,
3478 "outputStateIn",
"outputStateOut");
3479 ValidateTensorDataTypesMatch(cellStateInInfo, cellStateOutInfo, descriptorName,
"cellStateIn",
"cellStateOut");
3482 ValidateTensorQuantizationSpace(inputInfo, outputStateInInfo, descriptorName,
"input",
"outputStateIn");
3483 ValidateTensorQuantizationSpace(inputInfo, outputStateOutInfo, descriptorName,
"input",
"outputStateOut");
3484 ValidateTensorQuantizationSpace(cellStateInInfo, cellStateOutInfo, descriptorName,
"cellStateIn",
"cellStateOut");
3487 const uint32_t numBatches = inputInfo.
GetShape()[0];
3488 const uint32_t inputSize = inputInfo.
GetShape()[1];
3489 const uint32_t outputSize = cellStateInInfo.GetShape()[1];
3522 " RecurrentToForgetWeights");
3533 ValidateDataTypes(inputToInputWeightsInfo, weightsSupportedTypes, descriptorName);
3535 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, inputToForgetWeightsInfo, descriptorName,
3536 "inputToInputWeights",
"inputToForgetWeights");
3537 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, inputToCellWeightsInfo, descriptorName,
3538 "inputToInputWeights",
"inputToCellWeights");
3539 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, inputToOutputWeightsInfo, descriptorName,
3540 "inputToInputWeights",
"inputToOutputWeights");
3542 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, recurrentToInputWeightsInfo, descriptorName,
3543 "inputToInputWeights",
"recurrentToInputWeights");
3544 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, recurrentToForgetWeightsInfo, descriptorName,
3545 "inputToInputWeights",
"recurrentToForgeteights");
3546 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, recurrentToCellWeightsInfo, descriptorName,
3547 "inputToInputWeights",
"recurrentToCellWeights");
3548 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, recurrentToOutputWeightsInfo, descriptorName,
3549 "inputToInputWeights",
"recurrentToOutputWeights");
3552 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, inputToForgetWeightsInfo,
3553 descriptorName,
"inputToInputWeights",
"inputToForgetWeights");
3554 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, inputToCellWeightsInfo,
3555 descriptorName,
"inputToInputWeights",
"inputToCellWeights");
3556 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, inputToOutputWeightsInfo,
3557 descriptorName,
"inputToInputWeights",
"inputToOutputWeights");
3559 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, recurrentToInputWeightsInfo,
3560 descriptorName,
"inputToInputWeights",
"recurrentToInputWeights");
3561 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, recurrentToForgetWeightsInfo,
3562 descriptorName,
"inputToInputWeights",
"recurrentToForgetWeights");
3563 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, recurrentToCellWeightsInfo,
3564 descriptorName,
"inputToInputWeights",
"recurrentToCellWeights");
3565 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, recurrentToOutputWeightsInfo,
3566 descriptorName,
"inputToInputWeights",
"recurrentToOutputWeights");
3577 ValidatePointer(
m_CellBias, descriptorName,
"CellBias");
3586 ValidateDataTypes(inputGateBiasInfo, biasSupportedTypes, descriptorName);
3588 ValidateTensorDataTypesMatch(inputGateBiasInfo, forgetGateBiasInfo, descriptorName,
3589 "inputGateBias",
"forgetGateBias");
3590 ValidateTensorDataTypesMatch(inputGateBiasInfo, cellBiasInfo, descriptorName,
3591 "inputGateBias",
"cellBias");
3592 ValidateTensorDataTypesMatch(inputGateBiasInfo, outputGateBiasInfo, descriptorName,
3593 "inputGateBias",
"outputGateBias");
3596 ValidateBiasTensorQuantization(inputGateBiasInfo, inputToInputWeightsInfo, descriptorName);
3597 ValidateBiasTensorQuantization(forgetGateBiasInfo, inputToInputWeightsInfo, descriptorName);
3598 ValidateBiasTensorQuantization(cellBiasInfo, inputToInputWeightsInfo, descriptorName);
3599 ValidateBiasTensorQuantization(outputGateBiasInfo, inputToInputWeightsInfo, descriptorName);
3604 const std::string descriptorName{
"AbsQueueDescriptor"};
3606 ValidateNumInputs(workloadInfo, descriptorName, 1);
3607 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3612 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3614 std::vector<DataType> supportedTypes =
3625 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3626 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3631 const std::string descriptorName{
"SliceQueueDescriptor"};
3633 ValidateNumInputs(workloadInfo, descriptorName, 1);
3634 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3639 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3653 ": Length of begin offset descriptor must equal rank " + std::to_string(rank));
3658 ": Length of size descriptor must equal rank " + std::to_string(rank));
3663 for (
unsigned int i = 0u; i < rank; ++i)
3674 for(
unsigned int i = 0u; i < rank; ++i)
3679 std::to_string(i) +
" exceeds input size.");
3686 const std::string descriptorName{
"DepthToSpaceQueueDescriptor"};
3688 ValidateNumInputs(workloadInfo, descriptorName, 1);
3689 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3697 std::vector<DataType> supportedTypes =
3707 ValidateDataTypes(inputInfo, supportedTypes, descriptorName);
3708 ValidateDataTypes(outputInfo, supportedTypes, descriptorName);
3710 ValidateTensorNumElementsMatch(inputInfo, outputInfo, descriptorName,
"input",
"output");
3718 const unsigned int wIndex = dimensionIndices.
GetWidthIndex();
3726 "must be divisible by block size.");
3733 "must be divisible by the square of block size." );
3739 const std::string descriptorName{
"ComparisonQueueDescriptor"};
3741 ValidateNumInputs(workloadInfo, descriptorName, 2);
3742 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3748 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
3763 const std::string descriptorName{
"ElementwiseBinaryQueueDescriptor"};
3765 ValidateNumInputs(workloadInfo, descriptorName, 2);
3766 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3772 std::vector<DataType> supportedTypes =
3783 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
3784 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
3786 ValidateTensorDataTypesMatch(inputTensorInfo0, outputTensorInfo, descriptorName,
"input",
"output");
3787 ValidateTensorDataTypesMatch(inputTensorInfo1, outputTensorInfo, descriptorName,
"input",
"output");
3792 const std::string descriptorName{
"ElementwiseUnaryQueueDescriptor"};
3794 ValidateNumInputs(workloadInfo, descriptorName, 1);
3795 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3800 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3802 std::vector<DataType> supportedTypes =
3813 std::vector<DataType> logicalSupportedTypes =
3820 ValidateDataTypes(inputTensorInfo, logicalSupportedTypes, descriptorName);
3824 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3828 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3833 const std::string descriptorName{
"RankQueueDescriptor"};
3835 ValidateNumInputs(workloadInfo, descriptorName, 1);
3836 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3842 ValidateTensorNumElements(outputTensorInfo, descriptorName, 1,
"output");
3844 std::vector<DataType> supportedTypes =
3856 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3862 const std::string descriptorName{
"LogicalBinaryQueueDescriptor"};
3864 ValidateNumInputs(workloadInfo, descriptorName, 2);
3865 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3871 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
3896 const std::string descriptorName{
"ReduceQueueDescriptor"};
3898 ValidateNumInputs(workloadInfo, descriptorName, 1);
3899 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3904 std::vector<DataType> supportedTypes =
3915 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3916 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3923 const std::string descriptorName{
"UnidirectionalSequenceLstmQueueDescriptor"};
3935 std::vector<DataType> supportedTypes =
3942 ValidateDataTypes(workloadInfo.
m_InputTensorInfos[0], supportedTypes, descriptorName);
3956 unsigned int batchIndx = 0;
3957 unsigned int inputIndx = 1;
3958 uint32_t timeStep = 1;
3959 unsigned int timeIndx = 1;
3979 descriptorName +
" input_0");
3982 descriptorName +
" input_1");
3985 descriptorName +
" input_2");
3989 descriptorName +
" output_0");
3995 (n_cell * n_input),
"InputLayerNormWeights");
4000 (n_cell * n_input),
"InputToForgetWeights");
4004 (n_cell * n_input),
"InputToCellWeights");
4009 (n_cell * n_output),
"RecurrentToInputWeights");
4014 (n_cell * n_output),
"RecurrentToForgetWeights");
4018 (n_cell * n_output),
"RecurrentToCellWeights");
4026 if (!cifg_weights_all_or_none)
4029 "RecurrentToInputWeights must either both be present (regular LSTM) "
4030 "or both not present (CIFG-LSTM). In addition CifgEnable must be set "
4037 n_cell,
"CellToInputWeights");
4042 n_cell,
"CellToForgetWeights");
4047 n_cell,
"CellToOutputWeights");
4051 bool peephole_weights_all_or_none =
4056 if (!peephole_weights_all_or_none)
4074 "must be present.");
4077 n_cell,
"InputGateBias");
4083 ValidatePointer(
m_CellBias,
"Null pointer check",
"CellBias");
4092 (n_cell * n_output),
"ProjectionWeights");
4109 if (!projecton_tensors_consistent)
4142 "disabled but InputLayerNormWeights are not present");
4145 1, n_cell,
"InputLayerNormWeights");
4154 "ForgetLayerNormWeights");
4158 "OutputLayerNormWeights");
4162 "CellLayerNormWeights");
4168 "normalisation weights are present.");
4174 const std::string descriptorName{
"BatchMatMulDescriptor"};
4176 ValidateNumInputs(workloadInfo, descriptorName, 2);
4177 ValidateNumOutputs(workloadInfo, descriptorName, 1);
4188 std::vector<DataType> supportedTypes =
4198 ValidateDataTypes(inputXInfoBeforeParams, supportedTypes, descriptorName);
4199 ValidateDataTypes(inputYInfoBeforeParams, supportedTypes, descriptorName);
4200 ValidateDataTypes(outputInfo, supportedTypes, descriptorName);
4202 if ((inputXInfoBeforeParams.GetNumDimensions() < 2) ||
4203 (inputYInfoBeforeParams.GetNumDimensions() < 2))
4215 ": Invalid descriptor parameters - Transpose and Adjoint "
4216 "cannot both be true for a given input tensor.");
4223 inputXInfoBeforeParams.GetShape()));
4228 inputXInfoBeforeParams.GetShape());
4229 if(inputXInfoBeforeParams.GetShape()[axesToMul.first] !=
4230 inputXInfoBeforeParams.GetShape()[axesToMul.second])
4233 ": Adjoint is set to true for input tensor X, but the axes to be adjointed are not square." );
4236 inputXInfoAfterParams = inputXInfoBeforeParams;
4240 inputXInfoAfterParams = inputXInfoBeforeParams;
4248 inputYInfoBeforeParams.GetShape()));
4253 inputYInfoBeforeParams.GetShape());
4254 if(inputYInfoBeforeParams.GetShape()[axesToMul.first] !=
4255 inputYInfoBeforeParams.GetShape()[axesToMul.second])
4258 ": Adjoint is set to true for input tensor Y, but the axes to be adjointed are not square." );
4261 inputYInfoAfterParams = inputYInfoBeforeParams;
4265 inputYInfoAfterParams = inputYInfoBeforeParams;
4275 ": Input tensor X does not have the correct "
4276 "number of dimensions for the Data Layout that it has been assigned.");
4292 ": Input tensor Y does not have the correct "
4293 "number of dimensions for the Data Layout that it has been assigned.");
4305 inputXInfoBeforeParams.GetShape());
4307 if(inputXInfoAfterParams.
GetShape()[axesXToMul.second]
4308 != inputYInfoAfterParams.
GetShape()[axesYToMul.first])
4311 ": The final axis of input tensor X must be the same size as "
4312 "the second last axis of input tensor Y.");
4325 ": Invalid input tensor data layout combination.");
4333 ": Invalid input tensor data layout combination.");
4339 unsigned int outputTensorDimSize = std::max(inputXInfoAfterParams.
GetNumDimensions(),
4341 if(outputTensorDimSize-2 > 0)
4350 auto doAxisExtension = [&](std::vector<unsigned int> axisIndices,
TensorInfo& ti)
4352 auto sizeDiff = (outputTensorDimSize-2) - axisIndices.size();
4354 for(
unsigned int i = 0; i < sizeDiff; i++)
4356 axisIndices.insert(axisIndices.begin(), 1);
4359 for(
unsigned int i = 0; i < ti.GetNumDimensions(); i++)
4361 ti.GetShape()[i] = inputXInfoAfterParams.
GetShape()[i];
4370 doAxisExtension(axesXNotMul, tiXNotMul);
4371 doAxisExtension(axesYNotMul, tiYNotMul);
4379 ValidateBroadcastTensorShapesMatch(tiXNotMul,
4390 const std::string& descriptorName{
"TileQueueDescriptor"};
4392 ValidateNumInputs(workloadInfo, descriptorName, 1);
4393 ValidateNumOutputs(workloadInfo, descriptorName, 1);
4398 std::vector<DataType> supportedTypes =
4413 ": Multiples length is not same as the number of dimensions in Input.");
4416 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
4417 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
4422 const std::string& descriptorName{
"BroadcastToQueueDescriptor"};
4424 ValidateNumInputs(workloadInfo, descriptorName, 1);
4425 ValidateNumOutputs(workloadInfo, descriptorName, 1);
4430 std::vector<DataType> supportedTypes =
4442 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
4443 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);