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 =
1599 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1600 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1603 const unsigned int inputBatchSize = inputTensorInfo.
GetShape()[0];
1604 const unsigned int outputBatchSize = outputTensorInfo.
GetShape()[0];
1605 if (inputBatchSize != outputBatchSize)
1608 fmt::format(
"{}: Input batch size ({}) does not match output batch size ({})",
1609 descriptorName, inputBatchSize, outputBatchSize));
1615 if (inputChannelCount != outputChannelCount)
1618 fmt::format(
"{}: Input channel count ({}) does not match output channel count ({})",
1619 descriptorName, inputChannelCount, outputChannelCount));
1625 const std::string descriptorName{
"ReverseV2QueueDescriptor"};
1628 const unsigned int maxDimensions = 4;
1630 ValidateNumInputs(workloadInfo, descriptorName, 2);
1631 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1638 if (inputTensorNumDimensions > maxDimensions)
1641 ": Input tensors with rank greater than " +
1642 std::to_string(maxDimensions) +
" are not supported.");
1646 if (axisTensorNumDimensions > maxDimensions)
1649 ": More than " + std::to_string(maxDimensions) +
" axes cannot be specified.");
1652 if (axisTensorNumDimensions > inputTensorNumDimensions)
1655 ": More axes specified than the number of axes on the input tensor.");
1658 std::vector<DataType> supportedTypes =
1670 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1672 std::vector<DataType> axisSupportedTypes =
1677 ValidateDataTypes(axisTensorInfo, axisSupportedTypes, descriptorName);
1679 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1680 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1685 const std::string descriptorName{
"FakeQuantizationQueueDescriptor"};
1687 ValidateNumInputs(workloadInfo, descriptorName, 1);
1688 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1696 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1706 const std::string descriptorName{
"InstanceNormalizationQueueDescriptor"};
1708 ValidateNumInputs(workloadInfo, descriptorName, 1);
1709 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1719 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1722 std::vector<DataType> supportedTypes =
1729 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1730 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1735 const std::string descriptorName{
"L2NormalizationQueueDescriptor"};
1737 ValidateNumInputs(workloadInfo, descriptorName, 1);
1738 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1748 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1751 std::vector<DataType> supportedTypes =
1761 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1762 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1767 const std::string descriptorName{
"LogSoftmaxQueueDescriptor"};
1769 ValidateNumInputs(workloadInfo, descriptorName, 1);
1770 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1775 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1777 std::vector<DataType> supportedTypes =
1784 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1785 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1790 const std::string descriptorName{
"ConstantQueueDescriptor"};
1792 ValidateNumInputs(workloadInfo, descriptorName, 0);
1793 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1804 std::vector<DataType> supportedTypes =
1816 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1821 const std::string descriptorName{
"ReshapeQueueDescriptor"};
1823 ValidateNumInputs(workloadInfo, descriptorName, 1);
1824 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1829 ValidateTensorNumElementsMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1832 std::vector<DataType> supportedTypes =
1844 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1845 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1850 const std::string descriptorName{
"SpaceToBatchNdQueueDescriptor"};
1852 ValidateNumInputs(workloadInfo, descriptorName, 1);
1853 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1861 "dimensions as Block Shape.");
1883 const unsigned int inputWidth = (inputTensorInfo.
GetNumDimensions() == 3) ? 1 :
1888 const unsigned int channelsIndex = channelsIndex_int < 0 ?
1889 static_cast<unsigned int>(channelsIndex_int) + inputTensorInfo.
GetNumDimensions()
1890 :
static_cast<unsigned int>(channelsIndex_int);
1892 const unsigned int numInputElements = inputTensorInfo.
GetShape()[0] *
1895 inputTensorInfo.
GetShape()[channelsIndex];
1900 to_string(numInputElements) +
" after padding but output tensor has " +
1909 unsigned int spatialDimension = firstSpatialDimension + i;
1910 auto inputSize = inputTensorInfo.
GetShape()[spatialDimension] +
1916 "divisible by Block Shape in dimension: " + to_string(spatialDimension) +
".");
1920 std::vector<DataType> supportedTypes =
1930 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1931 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1936 const std::string descriptorName{
"SpaceToDepthQueueDescriptor"};
1938 ValidateNumInputs(workloadInfo, descriptorName, 1);
1939 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1947 std::vector<DataType> supportedTypes =
1957 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1958 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1960 ValidateTensorNumElementsMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
1968 const unsigned int wIndex = dimensionIndices.
GetWidthIndex();
1976 "by block size in all spatial dimensions");
1983 "must be divisible by the square of block size." );
1989 const std::string descriptorName{
"FloorQueueDescriptor"};
1991 ValidateNumInputs(workloadInfo, descriptorName, 1);
1992 ValidateNumOutputs(workloadInfo, descriptorName, 1);
1997 std::vector<DataType> supportedTypes =
2005 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2006 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2007 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2008 ValidateTensorQuantizationSpace(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2015 const std::string descriptorName{
"LstmQueueDescriptor"};
2027 std::vector<DataType> supportedTypes =
2036 ValidateDataTypes(workloadInfo.
m_InputTensorInfos[0], supportedTypes, descriptorName);
2045 "input_" + std::to_string(i));
2052 "LstmQueueDescriptor",
2054 "output_" + std::to_string(i));
2079 descriptorName +
" input_0");
2082 descriptorName +
" input_1");
2085 descriptorName +
" input_2");
2089 descriptorName +
" output_0");
2092 descriptorName +
" output_1");
2095 descriptorName +
" output_2");
2098 descriptorName +
" output_3");
2104 (n_cell * n_input),
"InputLayerNormWeights");
2109 (n_cell * n_input),
"InputToForgetWeights");
2113 (n_cell * n_input),
"InputToCellWeights");
2118 (n_cell * n_output),
"RecurrentToInputWeights");
2123 (n_cell * n_output),
"RecurrentToForgetWeights");
2127 (n_cell * n_output),
"RecurrentToCellWeights");
2135 if (!cifg_weights_all_or_none)
2138 "RecurrentToInputWeights must either both be present (regular LSTM) "
2139 "or both not present (CIFG-LSTM). In addition CifgEnable must be set "
2146 n_cell,
"CellToInputWeights");
2151 n_cell,
"CellToForgetWeights");
2156 n_cell,
"CellToOutputWeights");
2160 bool peephole_weights_all_or_none =
2165 if (!peephole_weights_all_or_none)
2183 "must be present.");
2186 n_cell,
"InputGateBias");
2192 ValidatePointer(
m_CellBias,
"Null pointer check",
"CellBias");
2201 (n_cell * n_output),
"ProjectionWeights");
2218 if (!projecton_tensors_consistent)
2251 "disabled but InputLayerNormWeights are not present");
2254 1, n_cell,
"InputLayerNormWeights");
2263 "ForgetLayerNormWeights");
2267 "OutputLayerNormWeights");
2271 "CellLayerNormWeights");
2277 "normalisation weights are present.");
2283 const std::string descriptorName{
"ConvertFp32ToFp16QueueDescriptor"};
2285 ValidateNumInputs(workloadInfo, descriptorName, 1);
2286 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2301 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2306 const std::string descriptorName{
"ConvertFp16ToFp32QueueDescriptor"};
2308 ValidateNumInputs(workloadInfo, descriptorName, 1);
2309 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2324 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2329 const std::string descriptorName{
"DivisionQueueDescriptor"};
2331 ValidateNumInputs(workloadInfo, descriptorName, 2);
2332 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2338 std::vector<DataType> supportedTypes =
2349 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2350 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2351 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
2353 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2363 const std::string descriptorName{
"SubtractionQueueDescriptor"};
2365 ValidateNumInputs(workloadInfo, descriptorName, 2);
2366 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2372 std::vector<DataType> supportedTypes =
2383 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2384 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2385 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
2387 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2397 const std::string descriptorName{
"MaximumQueueDescriptor"};
2399 ValidateNumInputs(workloadInfo, descriptorName, 2);
2400 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2406 std::vector<DataType> supportedTypes =
2417 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2418 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2419 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
2421 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2431 const std::string descriptorName{
"MeanQueueDescriptor"};
2433 ValidateNumInputs(workloadInfo, descriptorName, 1);
2434 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2439 std::vector<DataType> supportedTypes =
2451 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2452 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2464 unsigned int outputDim =
2468 outputDim > 0 ? outputDim : 1,
2475 const std::string descriptorName{
"PadQueueDescriptor"};
2477 ValidateNumInputs(workloadInfo, descriptorName, 1);
2478 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2489 "as there are dimensions in the input tensor that is " +
2497 const std::string descriptorName{
"QuantizeQueueDescriptor"};
2499 ValidateNumInputs(workloadInfo, descriptorName, 1);
2500 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2505 std::vector<DataType> supportedTypes =
2516 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2526 const std::string descriptorName{
"BatchToSpaceNdQueueDescriptor"};
2528 ValidateNumInputs(workloadInfo, descriptorName, 1);
2529 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2537 "dimensions as Block Shape.");
2560 unsigned int spatialDimension = firstSpatialDimension + i;
2563 if (cropSize > outputSize)
2566 "outputSize in dimension: " + to_string(spatialDimension) +
".");
2570 std::vector<DataType> supportedTypes =
2580 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2581 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2586 const std::string descriptorName{
"StridedSliceQueueDescriptor"};
2588 ValidateNumInputs(workloadInfo, descriptorName, 1);
2589 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2594 std::vector<DataType> supportedTypes =
2604 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2605 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2607 ValidateTensorQuantizationSpace(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2643 const std::string descriptorName{
"MinimumQueueDescriptor"};
2645 ValidateNumInputs(workloadInfo, descriptorName, 2);
2646 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2652 std::vector<DataType> supportedTypes =
2663 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2664 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2665 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
2667 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2677 const std::string descriptorName{
"DebugQueueDescriptor"};
2679 ValidateNumInputs(workloadInfo, descriptorName, 1);
2680 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2685 const std::string descriptorName{
"EqualQueueDescriptor"};
2687 ValidateNumInputs(workloadInfo, descriptorName, 2);
2688 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2694 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2709 const std::string descriptorName{
"GreaterQueueDescriptor"};
2711 ValidateNumInputs(workloadInfo, descriptorName, 2);
2712 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2718 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
2733 const std::string descriptorName{
"RsqrtQueueDescriptor"};
2735 ValidateNumInputs(workloadInfo, descriptorName, 1);
2736 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2741 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2743 std::vector<DataType> supportedTypes =
2753 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2754 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2759 const std::string descriptorName{
"GatherNdQueueDescriptor"};
2761 ValidateNumInputs(workloadInfo, descriptorName, 2);
2762 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2773 std::vector<DataType> supportedTypes =
2784 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2786 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2794 const std::string descriptorName{
"GatherQueueDescriptor"};
2796 ValidateNumInputs(workloadInfo, descriptorName, 2);
2797 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2808 std::vector<DataType> supportedTypes =
2819 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2821 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
2829 const std::string& descriptorName{
"DetectionPostProcessQueueDescriptor"};
2831 ValidateNumInputs(workloadInfo, descriptorName, 2);
2857 const std::vector<DataType> supportedInputTypes =
2867 ValidateDataTypes(boxEncodingsInfo, supportedInputTypes, descriptorName);
2868 ValidateDataTypes(scoresInfo, supportedInputTypes, descriptorName);
2869 ValidateDataTypes(anchorsInfo, supportedInputTypes, descriptorName);
2877 ValidateTensorDataType(detectionBoxesInfo,
DataType::Float32, descriptorName,
"detection boxes");
2878 ValidateTensorDataType(detectionScoresInfo,
DataType::Float32, descriptorName,
"detection scores");
2879 ValidateTensorDataType(detectionClassesInfo,
DataType::Float32, descriptorName,
"detection classes");
2880 ValidateTensorDataType(numDetectionsInfo,
DataType::Float32, descriptorName,
"num detections");
2885 "must be positive and less than or equal to 1.");
2891 "should be equal to number of classes + 1.");
2897 const std::string& descriptorName{
"DequantizeQueueDescriptor"};
2899 ValidateNumInputs(workloadInfo, descriptorName, 1);
2900 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2905 std::vector<DataType> inputSupportedTypes =
2913 ValidateDataTypes(inputTensorInfo, inputSupportedTypes, descriptorName);
2915 std::vector<DataType> outputSupportedTypes =
2922 ValidateDataTypes(outputTensorInfo, outputSupportedTypes, descriptorName);
2927 const std::string& descriptorName{
"MergeQueueDescriptor"};
2929 ValidateNumInputs(workloadInfo, descriptorName, 2);
2930 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2936 ValidateTensorShapesMatch(inputTensorInfo0, inputTensorInfo1, descriptorName,
"input_0",
"input_1");
2937 ValidateTensorShapesMatch(inputTensorInfo0, outputTensorInfo, descriptorName,
"input_0",
"output");
2939 ValidateTensorDataTypesMatch(inputTensorInfo0, inputTensorInfo1, descriptorName,
"input_0",
"input_1");
2940 ValidateTensorDataTypesMatch(inputTensorInfo0, outputTensorInfo, descriptorName,
"input_0",
"output");
2945 const std::string& descriptorName{
"ShapeQueueDescriptor"};
2947 ValidateNumInputs(workloadInfo, descriptorName, 1);
2948 ValidateNumOutputs(workloadInfo, descriptorName, 1);
2953 std::vector<DataType> supportedTypes =
2965 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2971 const std::string& descriptorName{
"SwitchQueueDescriptor"};
2973 ValidateNumInputs(workloadInfo, descriptorName, 2);
2974 ValidateNumOutputs(workloadInfo, descriptorName, 2);
2982 std::vector<DataType> supportedTypes =
2991 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
2992 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
2994 ValidateDataTypes(outputTensorInfo0, supportedTypes, descriptorName);
2995 ValidateDataTypes(outputTensorInfo1, supportedTypes, descriptorName);
2997 ValidateTensorShapesMatch(inputTensorInfo0,
3003 ValidateTensorShapesMatch(inputTensorInfo0,
3017 const std::string& descriptorName{
"PreluQueueDescriptor"};
3019 ValidateNumInputs(workloadInfo, descriptorName, 2);
3020 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3026 std::vector<DataType> supportedTypes
3036 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3037 ValidateDataTypes(alphaTensorInfo, supportedTypes, descriptorName);
3039 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
3041 ValidateTensorDataTypesMatch(inputTensorInfo, alphaTensorInfo, descriptorName,
"input",
"alpha");
3042 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"ouptut");
3044 ValidateBroadcastTensorShapesMatch(inputTensorInfo,
3054 const std::string descriptorName{
"TransposeConvolution2dQueueDescriptor"};
3056 ValidateNumInputs(workloadInfo, descriptorName, 1);
3057 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3065 ValidatePointer(
m_Weight, descriptorName,
"weight");
3070 ValidateWeightDataType(inputTensorInfo, weightTensorInfo, descriptorName);
3075 ValidatePointer(
m_Bias, descriptorName,
"bias");
3081 ValidateBiasTensorQuantization(biasTensorInfo, weightTensorInfo, descriptorName);
3084 ValidatePerAxisQuantization(inputTensorInfo,
3087 optionalBiasTensorInfo,
3090 std::vector<DataType> supportedTypes =
3100 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3101 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3106 const std::string descriptorName{
"TransposeQueueDescriptor"};
3108 ValidateNumInputs(workloadInfo, descriptorName, 1);
3109 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3119 for (
unsigned int i = 0u; i < mapping.
GetSize(); ++i)
3121 if (inputTensorInfo.
GetShape()[mapping[i]] != outputTensorInfo.
GetShape()[i])
3124 " (=" + to_string(inputTensorInfo.
GetShape()[mapping[i]]) +
") " +
3125 "must match dst dimension " + to_string(i) +
3126 " (=" + to_string(outputTensorInfo.
GetShape()[i]) +
")");
3130 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3135 const std::string descriptorName{
"TransposeQueueDescriptor"};
3137 ValidateNumInputs(workloadInfo, descriptorName, 1);
3138 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3143 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3148 const std::string descriptorName{
"QLstmQueueDescriptor"};
3151 ValidateNumInputs(workloadInfo, descriptorName, 3);
3152 ValidateNumOutputs(workloadInfo, descriptorName, 3);
3164 std::vector<DataType> inputOutputSupportedTypes =
3169 std::vector<DataType> cellStateSupportedTypes =
3174 std::vector<DataType> weightsSupportedTypes =
3179 std::vector<DataType> layerNormPeepholeWeightsSupportedTypes =
3184 std::vector<DataType> biasSupportedTypes =
3190 ValidateDataTypes(inputInfo, inputOutputSupportedTypes, descriptorName);
3191 ValidateDataTypes(outputStateInInfo, inputOutputSupportedTypes, descriptorName);
3192 ValidateDataTypes(cellStateInInfo, cellStateSupportedTypes, descriptorName);
3194 ValidateDataTypes(outputStateOutInfo, inputOutputSupportedTypes, descriptorName);
3195 ValidateDataTypes(cellStateOutInfo, cellStateSupportedTypes, descriptorName);
3196 ValidateDataTypes(outputInfo, inputOutputSupportedTypes, descriptorName);
3199 ValidateTensorDataTypesMatch(inputInfo, outputStateInInfo, descriptorName,
"input",
"outputStateIn");
3200 ValidateTensorDataTypesMatch(outputStateInInfo, outputStateOutInfo, descriptorName,
3201 "outputStateIn",
"outputStateOut");
3202 ValidateTensorDataTypesMatch(cellStateInInfo, cellStateOutInfo, descriptorName,
"cellStateIn",
"cellStateOut");
3205 const uint32_t numBatches = inputInfo.
GetShape()[0];
3206 const uint32_t inputSize = inputInfo.
GetShape()[1];
3207 const uint32_t outputSize = outputStateInInfo.GetShape()[1];
3208 const uint32_t numUnits = cellStateInInfo.GetShape()[1];
3235 " RecurrentToForgetWeights");
3246 ValidateDataTypes(inputToForgetWeightsInfo, weightsSupportedTypes, descriptorName);
3248 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, inputToCellWeightsInfo, descriptorName,
3249 "inputToForgetWeights",
"inputToCellWeights");
3250 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, inputToOutputWeightsInfo, descriptorName,
3251 "inputToForgetWeights",
"inputToOutputWeights");
3253 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, recurrentToForgetWeightsInfo, descriptorName,
3254 "inputToForgetWeights",
"recurrentToForgeteights");
3255 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, recurrentToCellWeightsInfo, descriptorName,
3256 "inputToForgetWeights",
"recurrentToCellWeights");
3257 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, recurrentToOutputWeightsInfo, descriptorName,
3258 "inputToForgetWeights",
"recurrentToOutputWeights");
3265 ValidatePointer(
m_CellBias, descriptorName,
"CellBias");
3274 ValidateDataTypes(forgetGateBiasInfo, biasSupportedTypes, descriptorName);
3276 ValidateTensorDataTypesMatch(forgetGateBiasInfo, cellBiasInfo, descriptorName,
3277 "forgetGateBias",
"cellBias");
3278 ValidateTensorDataTypesMatch(forgetGateBiasInfo, outputGateBiasInfo, descriptorName,
3279 "forgetGateBias",
"outputGateBias");
3287 if (!allCifgParamsPresentOrNot)
3290 ": InputToInputWeights, RecurrentToInputWeights and InputGateBias must either all be present "
3291 "(CIFG disabled) or not be present at all (CIFG enabled). m_Parameters.m_CifgEnabled should be "
3292 "set appropriately.");
3303 " RecurrentToInputWeights");
3309 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, inputToInputWeightsInfo, descriptorName,
3310 "inputToForgetWeights",
"inputToInputWeights");
3311 ValidateTensorDataTypesMatch(inputToForgetWeightsInfo, recurrentToInputWeightsInfo, descriptorName,
3312 "inputToForgetWeights",
"recurrentToInputWeights");
3313 ValidateTensorDataTypesMatch(forgetGateBiasInfo, inputGateBiasInfo, descriptorName,
3314 "forgetGateBias",
"inputGateBias");
3318 bool allPeepholeWeightsPresentOrNot =
3324 if (!allPeepholeWeightsPresentOrNot)
3327 ": CellToInputWeights, CellToForgetWeights and CellToOutputWeights should all be present (Peephole "
3328 "enabled) or not be present at all (Peephole disabled). CellToInputWeights should only be present "
3329 "when Peephole is enabled and CIFG is disabled. m_Parameters.m_PeepholeEnabled should be set "
3337 ValidateDataTypes(cellToForgetWeightsInfo, layerNormPeepholeWeightsSupportedTypes, descriptorName);
3341 ValidateTensorDataTypesMatch(cellToForgetWeightsInfo, cellToOutputWeightsInfo, descriptorName,
3342 "cellToForgetWeight",
"cellToOutputWeights");
3348 ValidateTensorDataTypesMatch(cellToForgetWeightsInfo, cellToInputWeightsInfo, descriptorName,
3349 "cellToForgetWeights",
"cellToInputWeights");
3354 bool allLayerNormWeightsPresentOrNot =
3360 if (!allLayerNormWeightsPresentOrNot)
3363 ": InputLayerNormWeights, ForgetLayerNormWeights, m_OutputLayerNormWeights "
3364 "and CellLayerNormWeights should all be present (Layer Norm enabled) or not "
3365 "be present at all (Layer Norm disabled). InputLayerNormWeights should "
3366 "only be present when Layer Norm is enabled and CIFG is disabled. "
3367 "m_Parameters.m_LayerNormEnabled should be set appropriately.");
3374 ValidateDataTypes(forgetLayerNormWeightsInfo, layerNormPeepholeWeightsSupportedTypes, descriptorName);
3378 ValidateTensorDataTypesMatch(forgetLayerNormWeightsInfo, cellLayerNormWeightsInfo, descriptorName,
3379 "forgetLayerNormWeights",
"cellLayerNormWeights");
3383 ValidateTensorDataTypesMatch(forgetLayerNormWeightsInfo, outputLayerNormWeightsInfo, descriptorName,
3384 "forgetLayerNormWeights",
"outputLayerNormWeights");
3390 ValidateTensorDataTypesMatch(forgetLayerNormWeightsInfo, inputLayerNormWeightsInfo, descriptorName,
3391 "forgetLayerNormWeights",
"inputLayerNormWeights");
3396 bool correctProjectionTensorsPresent =
3401 if (!correctProjectionTensorsPresent)
3404 ": If projection is enabled, ProjectionWeights should be present and "
3405 "ProjectionBias is optional. If projection is disabled, neither "
3406 "ProjectionWeights nor ProjectionBias should be present.");
3413 ValidateDataTypes(projectionWeightsInfo, weightsSupportedTypes, descriptorName);
3419 ValidateDataTypes(projectionBiasInfo, biasSupportedTypes, descriptorName);
3426 ": If projection is disabled, output quantization info (scale, offset) "
3427 "should match HiddenStateScale and HiddenStateZeroPoint.");
3434 const std::string descriptorName{
"QuantizedLstmQueueDescriptor"};
3437 ValidateNumInputs(workloadInfo, descriptorName, 3);
3438 ValidateNumOutputs(workloadInfo, descriptorName, 2);
3448 std::vector<DataType> inputOutputSupportedTypes =
3453 std::vector<DataType> cellStateSupportedTypes =
3458 std::vector<DataType> weightsSupportedTypes =
3463 std::vector<DataType> biasSupportedTypes =
3469 ValidateDataTypes(inputInfo, inputOutputSupportedTypes, descriptorName);
3470 ValidateDataTypes(cellStateInInfo, cellStateSupportedTypes, descriptorName);
3471 ValidateDataTypes(outputStateInInfo, inputOutputSupportedTypes, descriptorName);
3473 ValidateDataTypes(cellStateOutInfo, cellStateSupportedTypes, descriptorName);
3474 ValidateDataTypes(outputStateOutInfo, inputOutputSupportedTypes, descriptorName);
3477 ValidateTensorDataTypesMatch(inputInfo, outputStateInInfo, descriptorName,
"input",
"outputStateIn");
3478 ValidateTensorDataTypesMatch(outputStateInInfo, outputStateOutInfo, descriptorName,
3479 "outputStateIn",
"outputStateOut");
3480 ValidateTensorDataTypesMatch(cellStateInInfo, cellStateOutInfo, descriptorName,
"cellStateIn",
"cellStateOut");
3483 ValidateTensorQuantizationSpace(inputInfo, outputStateInInfo, descriptorName,
"input",
"outputStateIn");
3484 ValidateTensorQuantizationSpace(inputInfo, outputStateOutInfo, descriptorName,
"input",
"outputStateOut");
3485 ValidateTensorQuantizationSpace(cellStateInInfo, cellStateOutInfo, descriptorName,
"cellStateIn",
"cellStateOut");
3488 const uint32_t numBatches = inputInfo.
GetShape()[0];
3489 const uint32_t inputSize = inputInfo.
GetShape()[1];
3490 const uint32_t outputSize = cellStateInInfo.GetShape()[1];
3523 " RecurrentToForgetWeights");
3534 ValidateDataTypes(inputToInputWeightsInfo, weightsSupportedTypes, descriptorName);
3536 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, inputToForgetWeightsInfo, descriptorName,
3537 "inputToInputWeights",
"inputToForgetWeights");
3538 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, inputToCellWeightsInfo, descriptorName,
3539 "inputToInputWeights",
"inputToCellWeights");
3540 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, inputToOutputWeightsInfo, descriptorName,
3541 "inputToInputWeights",
"inputToOutputWeights");
3543 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, recurrentToInputWeightsInfo, descriptorName,
3544 "inputToInputWeights",
"recurrentToInputWeights");
3545 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, recurrentToForgetWeightsInfo, descriptorName,
3546 "inputToInputWeights",
"recurrentToForgeteights");
3547 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, recurrentToCellWeightsInfo, descriptorName,
3548 "inputToInputWeights",
"recurrentToCellWeights");
3549 ValidateTensorDataTypesMatch(inputToInputWeightsInfo, recurrentToOutputWeightsInfo, descriptorName,
3550 "inputToInputWeights",
"recurrentToOutputWeights");
3553 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, inputToForgetWeightsInfo,
3554 descriptorName,
"inputToInputWeights",
"inputToForgetWeights");
3555 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, inputToCellWeightsInfo,
3556 descriptorName,
"inputToInputWeights",
"inputToCellWeights");
3557 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, inputToOutputWeightsInfo,
3558 descriptorName,
"inputToInputWeights",
"inputToOutputWeights");
3560 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, recurrentToInputWeightsInfo,
3561 descriptorName,
"inputToInputWeights",
"recurrentToInputWeights");
3562 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, recurrentToForgetWeightsInfo,
3563 descriptorName,
"inputToInputWeights",
"recurrentToForgetWeights");
3564 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, recurrentToCellWeightsInfo,
3565 descriptorName,
"inputToInputWeights",
"recurrentToCellWeights");
3566 ValidateTensorQuantizationSpace(inputToInputWeightsInfo, recurrentToOutputWeightsInfo,
3567 descriptorName,
"inputToInputWeights",
"recurrentToOutputWeights");
3578 ValidatePointer(
m_CellBias, descriptorName,
"CellBias");
3587 ValidateDataTypes(inputGateBiasInfo, biasSupportedTypes, descriptorName);
3589 ValidateTensorDataTypesMatch(inputGateBiasInfo, forgetGateBiasInfo, descriptorName,
3590 "inputGateBias",
"forgetGateBias");
3591 ValidateTensorDataTypesMatch(inputGateBiasInfo, cellBiasInfo, descriptorName,
3592 "inputGateBias",
"cellBias");
3593 ValidateTensorDataTypesMatch(inputGateBiasInfo, outputGateBiasInfo, descriptorName,
3594 "inputGateBias",
"outputGateBias");
3597 ValidateBiasTensorQuantization(inputGateBiasInfo, inputToInputWeightsInfo, descriptorName);
3598 ValidateBiasTensorQuantization(forgetGateBiasInfo, inputToInputWeightsInfo, descriptorName);
3599 ValidateBiasTensorQuantization(cellBiasInfo, inputToInputWeightsInfo, descriptorName);
3600 ValidateBiasTensorQuantization(outputGateBiasInfo, inputToInputWeightsInfo, descriptorName);
3605 const std::string descriptorName{
"AbsQueueDescriptor"};
3607 ValidateNumInputs(workloadInfo, descriptorName, 1);
3608 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3613 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3615 std::vector<DataType> supportedTypes =
3626 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3627 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3632 const std::string descriptorName{
"SliceQueueDescriptor"};
3634 ValidateNumInputs(workloadInfo, descriptorName, 1);
3635 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3640 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3654 ": Length of begin offset descriptor must equal rank " + std::to_string(rank));
3659 ": Length of size descriptor must equal rank " + std::to_string(rank));
3664 for (
unsigned int i = 0u; i < rank; ++i)
3675 for(
unsigned int i = 0u; i < rank; ++i)
3680 std::to_string(i) +
" exceeds input size.");
3687 const std::string descriptorName{
"DepthToSpaceQueueDescriptor"};
3689 ValidateNumInputs(workloadInfo, descriptorName, 1);
3690 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3698 std::vector<DataType> supportedTypes =
3708 ValidateDataTypes(inputInfo, supportedTypes, descriptorName);
3709 ValidateDataTypes(outputInfo, supportedTypes, descriptorName);
3711 ValidateTensorNumElementsMatch(inputInfo, outputInfo, descriptorName,
"input",
"output");
3719 const unsigned int wIndex = dimensionIndices.
GetWidthIndex();
3727 "must be divisible by block size.");
3734 "must be divisible by the square of block size." );
3740 const std::string descriptorName{
"ComparisonQueueDescriptor"};
3742 ValidateNumInputs(workloadInfo, descriptorName, 2);
3743 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3749 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
3764 const std::string descriptorName{
"ElementwiseBinaryQueueDescriptor"};
3766 ValidateNumInputs(workloadInfo, descriptorName, 2);
3767 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3773 std::vector<DataType> supportedTypes =
3784 ValidateDataTypes(inputTensorInfo0, supportedTypes, descriptorName);
3785 ValidateDataTypes(inputTensorInfo1, supportedTypes, descriptorName);
3787 ValidateTensorDataTypesMatch(inputTensorInfo0, outputTensorInfo, descriptorName,
"input",
"output");
3788 ValidateTensorDataTypesMatch(inputTensorInfo1, outputTensorInfo, descriptorName,
"input",
"output");
3793 const std::string descriptorName{
"ElementwiseUnaryQueueDescriptor"};
3795 ValidateNumInputs(workloadInfo, descriptorName, 1);
3796 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3801 ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3803 std::vector<DataType> supportedTypes =
3814 std::vector<DataType> logicalSupportedTypes =
3821 ValidateDataTypes(inputTensorInfo, logicalSupportedTypes, descriptorName);
3825 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3829 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3834 const std::string descriptorName{
"RankQueueDescriptor"};
3836 ValidateNumInputs(workloadInfo, descriptorName, 1);
3837 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3843 ValidateTensorNumElements(outputTensorInfo, descriptorName, 1,
"output");
3845 std::vector<DataType> supportedTypes =
3857 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3863 const std::string descriptorName{
"LogicalBinaryQueueDescriptor"};
3865 ValidateNumInputs(workloadInfo, descriptorName, 2);
3866 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3872 ValidateBroadcastTensorShapesMatch(inputTensorInfo0,
3897 const std::string descriptorName{
"ReduceQueueDescriptor"};
3899 ValidateNumInputs(workloadInfo, descriptorName, 1);
3900 ValidateNumOutputs(workloadInfo, descriptorName, 1);
3905 std::vector<DataType> supportedTypes =
3916 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
3917 ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName,
"input",
"output");
3924 const std::string descriptorName{
"UnidirectionalSequenceLstmQueueDescriptor"};
3936 std::vector<DataType> supportedTypes =
3943 ValidateDataTypes(workloadInfo.
m_InputTensorInfos[0], supportedTypes, descriptorName);
3957 unsigned int batchIndx = 0;
3958 unsigned int inputIndx = 1;
3959 uint32_t timeStep = 1;
3960 unsigned int timeIndx = 1;
3980 descriptorName +
" input_0");
3983 descriptorName +
" input_1");
3986 descriptorName +
" input_2");
3990 descriptorName +
" output_0");
3996 (n_cell * n_input),
"InputLayerNormWeights");
4001 (n_cell * n_input),
"InputToForgetWeights");
4005 (n_cell * n_input),
"InputToCellWeights");
4010 (n_cell * n_output),
"RecurrentToInputWeights");
4015 (n_cell * n_output),
"RecurrentToForgetWeights");
4019 (n_cell * n_output),
"RecurrentToCellWeights");
4027 if (!cifg_weights_all_or_none)
4030 "RecurrentToInputWeights must either both be present (regular LSTM) "
4031 "or both not present (CIFG-LSTM). In addition CifgEnable must be set "
4038 n_cell,
"CellToInputWeights");
4043 n_cell,
"CellToForgetWeights");
4048 n_cell,
"CellToOutputWeights");
4052 bool peephole_weights_all_or_none =
4057 if (!peephole_weights_all_or_none)
4075 "must be present.");
4078 n_cell,
"InputGateBias");
4084 ValidatePointer(
m_CellBias,
"Null pointer check",
"CellBias");
4093 (n_cell * n_output),
"ProjectionWeights");
4110 if (!projecton_tensors_consistent)
4143 "disabled but InputLayerNormWeights are not present");
4146 1, n_cell,
"InputLayerNormWeights");
4155 "ForgetLayerNormWeights");
4159 "OutputLayerNormWeights");
4163 "CellLayerNormWeights");
4169 "normalisation weights are present.");
4175 const std::string descriptorName{
"BatchMatMulDescriptor"};
4177 ValidateNumInputs(workloadInfo, descriptorName, 2);
4178 ValidateNumOutputs(workloadInfo, descriptorName, 1);
4189 std::vector<DataType> supportedTypes =
4199 ValidateDataTypes(inputXInfoBeforeParams, supportedTypes, descriptorName);
4200 ValidateDataTypes(inputYInfoBeforeParams, supportedTypes, descriptorName);
4201 ValidateDataTypes(outputInfo, supportedTypes, descriptorName);
4203 if ((inputXInfoBeforeParams.GetNumDimensions() < 2) ||
4204 (inputYInfoBeforeParams.GetNumDimensions() < 2))
4216 ": Invalid descriptor parameters - Transpose and Adjoint "
4217 "cannot both be true for a given input tensor.");
4224 inputXInfoBeforeParams.GetShape()));
4229 inputXInfoBeforeParams.GetShape());
4230 if(inputXInfoBeforeParams.GetShape()[axesToMul.first] !=
4231 inputXInfoBeforeParams.GetShape()[axesToMul.second])
4234 ": Adjoint is set to true for input tensor X, but the axes to be adjointed are not square." );
4237 inputXInfoAfterParams = inputXInfoBeforeParams;
4241 inputXInfoAfterParams = inputXInfoBeforeParams;
4249 inputYInfoBeforeParams.GetShape()));
4254 inputYInfoBeforeParams.GetShape());
4255 if(inputYInfoBeforeParams.GetShape()[axesToMul.first] !=
4256 inputYInfoBeforeParams.GetShape()[axesToMul.second])
4259 ": Adjoint is set to true for input tensor Y, but the axes to be adjointed are not square." );
4262 inputYInfoAfterParams = inputYInfoBeforeParams;
4266 inputYInfoAfterParams = inputYInfoBeforeParams;
4276 ": Input tensor X does not have the correct "
4277 "number of dimensions for the Data Layout that it has been assigned.");
4293 ": Input tensor Y does not have the correct "
4294 "number of dimensions for the Data Layout that it has been assigned.");
4306 inputXInfoBeforeParams.GetShape());
4308 if(inputXInfoAfterParams.
GetShape()[axesXToMul.second]
4309 != inputYInfoAfterParams.
GetShape()[axesYToMul.first])
4312 ": The final axis of input tensor X must be the same size as "
4313 "the second last axis of input tensor Y.");
4326 ": Invalid input tensor data layout combination.");
4334 ": Invalid input tensor data layout combination.");
4340 unsigned int outputTensorDimSize = std::max(inputXInfoAfterParams.
GetNumDimensions(),
4342 if(outputTensorDimSize-2 > 0)
4351 auto doAxisExtension = [&](std::vector<unsigned int> axisIndices,
TensorInfo& ti)
4353 auto sizeDiff = (outputTensorDimSize-2) - axisIndices.size();
4355 for(
unsigned int i = 0; i < sizeDiff; i++)
4357 axisIndices.insert(axisIndices.begin(), 1);
4360 for(
unsigned int i = 0; i < ti.GetNumDimensions(); i++)
4362 ti.GetShape()[i] = inputXInfoAfterParams.
GetShape()[i];
4371 doAxisExtension(axesXNotMul, tiXNotMul);
4372 doAxisExtension(axesYNotMul, tiYNotMul);
4380 ValidateBroadcastTensorShapesMatch(tiXNotMul,
4391 const std::string& descriptorName{
"TileQueueDescriptor"};
4393 ValidateNumInputs(workloadInfo, descriptorName, 1);
4394 ValidateNumOutputs(workloadInfo, descriptorName, 1);
4399 std::vector<DataType> supportedTypes =
4414 ": Multiples length is not same as the number of dimensions in Input.");
4417 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
4418 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
4423 const std::string& descriptorName{
"BroadcastToQueueDescriptor"};
4425 ValidateNumInputs(workloadInfo, descriptorName, 1);
4426 ValidateNumOutputs(workloadInfo, descriptorName, 1);
4431 std::vector<DataType> supportedTypes =
4443 ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
4444 ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);