Lines Matching refs:operands

69     OperationExecutionContext(const Operation* operation, RunTimeOperandInfo* operands)  in OperationExecutionContext()  argument
70 : operation(operation), operands(operands) {} in OperationExecutionContext()
102 RunTimeOperandInfo* operands; member in android::nn::__anon6fdaa8540110::OperationExecutionContext
109 return &operands[operation->inputs[index]]; in getInputInfo()
114 return &operands[operation->outputs[index]]; in getOutputInfo()
119 return &operands[operation->outputs[index]]; in getOutputInfo()
528 RunTimeOperandInfo* operands) { in consumeOperationInputs() argument
530 auto& info = operands[i]; in consumeOperationInputs()
546 static void freeUnusedSubgraphOperands(std::vector<RunTimeOperandInfo>* operands) { in freeUnusedSubgraphOperands() argument
547 for (auto& info : *operands) { in freeUnusedSubgraphOperands()
572 std::vector<RunTimeOperandInfo> operands = initializeRunTimeInfo(model.main); in run() local
573 updateForArguments(model.main.inputIndexes, request.inputs, requestPoolInfos, operands.data()); in run()
575 operands.data()); in run()
576 int result = executeSubgraph(model.main, operands.data()); in run()
577 freeUnusedSubgraphOperands(&operands); in run()
588 setOutputShapes(model.main.outputIndexes, operands); in run()
600 int CpuExecutor::executeSubgraph(const Model::Subgraph& subgraph, RunTimeOperandInfo* operands) { in executeSubgraph() argument
604 NN_RETURN_IF_ERROR(executeOperation(operation, operands)); in executeSubgraph()
612 const size_t count = subgraph.operands.size(); in initializeRunTimeInfo()
613 std::vector<RunTimeOperandInfo> operands(count); in initializeRunTimeInfo() local
617 const Operand& from = subgraph.operands[i]; in initializeRunTimeInfo()
618 RunTimeOperandInfo& to = operands[i]; in initializeRunTimeInfo()
663 return operands; in initializeRunTimeInfo()
669 RunTimeOperandInfo* operands) { in updateForArguments() argument
674 RunTimeOperandInfo& to = operands[operandIndex]; in updateForArguments()
718 int CpuExecutor::executeOperation(const Operation& operation, RunTimeOperandInfo* operands) { in executeOperation() argument
724 int result = executeIfOperation(operation, operands); in executeOperation()
731 int result = executeWhileOperation(operation, operands); in executeOperation()
749 auto allParametersPresent = [&operation, &operands, &ins, &outs](size_t requiredIns, in executeOperation()
751 auto verify = [&operation, &operands](size_t requiredCount, in executeOperation()
761 if (operands[indexes[i]].lifetime == Operand::LifeTime::NO_VALUE) { in executeOperation()
771 &operands](const std::vector<uint32_t>& indexes) { in executeOperation()
773 for (size_t j = 0; j < operands[indexes[i]].dimensions.size(); j++) { in executeOperation()
774 if (operands[indexes[i]].dimensions[j] == 0) { in executeOperation()
798 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
799 const RunTimeOperandInfo& targetShape = operands[ins[1]]; in executeOperation()
801 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
815 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
816 int32_t blockSize = getScalarData<int32_t>(operands[ins[1]]); in executeOperation()
817 bool data_layout = inCount == 3 ? getScalarData<bool>(operands[ins[2]]) : false; in executeOperation()
819 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
879 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
880 int32_t blockSize = getScalarData<int32_t>(operands[ins[1]]); in executeOperation()
881 bool data_layout = inCount == 3 ? getScalarData<bool>(operands[ins[2]]) : false; in executeOperation()
883 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
943 const RunTimeOperandInfo& values = operands[ins[EmbeddingLookup::kValueTensor]]; in executeOperation()
944 const RunTimeOperandInfo& lookups = operands[ins[EmbeddingLookup::kLookupTensor]]; in executeOperation()
945 RunTimeOperandInfo& output = operands[outs[EmbeddingLookup::kOutputTensor]]; in executeOperation()
948 EmbeddingLookup lookup(operation, operands); in executeOperation()
957 const RunTimeOperandInfo& lookups = operands[ins[HashtableLookup::kLookupTensor]]; in executeOperation()
958 const RunTimeOperandInfo& keys = operands[ins[HashtableLookup::kKeyTensor]]; in executeOperation()
959 const RunTimeOperandInfo& values = operands[ins[HashtableLookup::kValueTensor]]; in executeOperation()
961 RunTimeOperandInfo& output = operands[outs[HashtableLookup::kOutputTensor]]; in executeOperation()
962 RunTimeOperandInfo& hits = operands[outs[HashtableLookup::kHitsTensor]]; in executeOperation()
965 HashtableLookup lookup(operation, operands); in executeOperation()
973 RunTimeOperandInfo& output = operands[outs[LSHProjection::kOutputTensor]]; in executeOperation()
975 if (!LSHProjection::Prepare(operation, operands, &outputShape) || in executeOperation()
980 LSHProjection lsh(operation, operands); in executeOperation()
981 const RunTimeOperandInfo& hash = operands[ins[LSHProjection::kHashTensor]]; in executeOperation()
999 operands[ins[BidirectionalSequenceLSTM::kMergeOutputsParam]]); in executeOperation()
1002 operands[outs[BidirectionalSequenceLSTM::kFwOutputTensor]]; in executeOperation()
1006 BidirectionalSequenceLSTM lstm(operation, operands); in executeOperation()
1007 success = lstm.Prepare(operation, operands, &fwOutputShape, &bwOutputShape, in executeOperation()
1013 operands[outs[BidirectionalSequenceLSTM::kBwOutputTensor]]; in executeOperation()
1019 operands[outs[BidirectionalSequenceLSTM::kFwOutputActivationStateTensor - in executeOperation()
1022 operands[outs[BidirectionalSequenceLSTM::kFwOutputCellStateTensor - delta]]; in executeOperation()
1024 operands[outs[BidirectionalSequenceLSTM::kBwOutputActivationStateTensor - in executeOperation()
1027 operands[outs[BidirectionalSequenceLSTM::kBwOutputCellStateTensor - delta]]; in executeOperation()
1041 RunTimeOperandInfo& scratch = operands[outs[LSTMCell::kScratchBufferTensor]]; in executeOperation()
1042 RunTimeOperandInfo& outputStateOut = operands[outs[LSTMCell::kOutputStateOutTensor]]; in executeOperation()
1043 RunTimeOperandInfo& cellStateOut = operands[outs[LSTMCell::kCellStateOutTensor]]; in executeOperation()
1044 RunTimeOperandInfo& output = operands[outs[LSTMCell::kOutputTensor]]; in executeOperation()
1047 LSTMCell lstm_cell(operation, operands); in executeOperation()
1049 success = lstm_cell.Prepare(operation, operands, &scratchShape, &outputStateShape, in executeOperation()
1060 RunTimeOperandInfo& output = operands[outs[Multinomial::kOutputTensor]]; in executeOperation()
1063 Multinomial multinomial(operation, operands); in executeOperation()
1065 success = Multinomial::Prepare(operation, operands, &outputShape) && in executeOperation()
1074 RunTimeOperandInfo& hiddenStateOut = operands[outs[RNN::kHiddenStateOutTensor]]; in executeOperation()
1075 RunTimeOperandInfo& output = operands[outs[RNN::kOutputTensor]]; in executeOperation()
1078 RNN rnn_cell(operation, operands); in executeOperation()
1080 success = RNN::Prepare(operation, operands, &hiddenStateShape, &outputShape) && in executeOperation()
1085 RunTimeOperandInfo& stateOut = operands[outs[SVDF::kStateOutTensor]]; in executeOperation()
1086 RunTimeOperandInfo& output = operands[outs[SVDF::kOutputTensor]]; in executeOperation()
1089 SVDF svdf(operation, operands); in executeOperation()
1091 success = SVDF::Prepare(operation, operands, &stateShape, &outputShape) && in executeOperation()
1100 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1101 const RunTimeOperandInfo& blockSize = operands[ins[1]]; in executeOperation()
1102 bool data_layout = inCount == 3 ? getScalarData<bool>(operands[ins[2]]) : false; in executeOperation()
1104 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1171 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1172 const RunTimeOperandInfo& blockSize = operands[ins[1]]; in executeOperation()
1173 const RunTimeOperandInfo& paddings = operands[ins[2]]; in executeOperation()
1174 bool data_layout = inCount == 4 ? getScalarData<bool>(operands[ins[3]]) : false; in executeOperation()
1176 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1249 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1250 const RunTimeOperandInfo& paddings = operands[ins[1]]; in executeOperation()
1252 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1261 float pad_value = isV2 ? getScalarData<float>(operands[ins[2]]) : 0; in executeOperation()
1266 _Float16 pad_value = isV2 ? getScalarData<_Float16>(operands[ins[2]]) : 0; in executeOperation()
1273 isV2 ? getScalarData<uint8_t>(operands[ins[2]]) : outShape.offset; in executeOperation()
1279 isV2 ? getScalarData<int8_t>(operands[ins[2]]) : outShape.offset; in executeOperation()
1289 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1291 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1302 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1303 const RunTimeOperandInfo& axis = operands[ins[1]]; in executeOperation()
1304 int32_t keepDims = getScalarData<int32_t>(operands[ins[2]]); in executeOperation()
1306 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1341 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1342 int32_t axis = getScalarData<int32_t>(operands[ins[1]]); in executeOperation()
1344 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1357 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1358 int32_t axis = getScalarData<int32_t>(operands[ins[1]]); in executeOperation()
1360 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1373 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1374 const int32_t axis = getScalarData<int32_t>(operands[ins[1]]); in executeOperation()
1375 const int32_t numOutputs = getScalarData<int32_t>(operands[ins[2]]); in executeOperation()
1383 outputShapes[i] = operands[outs[i]].shape(); in executeOperation()
1388 success = success && setInfoAndAllocateIfNeeded(&(operands[outs[i]]), in executeOperation()
1395 outputDataPtrs[i] = reinterpret_cast<_Float16*>(operands[outs[i]].buffer); in executeOperation()
1404 outputDataPtrs[i] = reinterpret_cast<float*>(operands[outs[i]].buffer); in executeOperation()
1413 outputDataPtrs[i] = reinterpret_cast<int32_t*>(operands[outs[i]].buffer); in executeOperation()
1422 outputDataPtrs[i] = reinterpret_cast<uint8_t*>(operands[outs[i]].buffer); in executeOperation()
1431 outputDataPtrs[i] = reinterpret_cast<int8_t*>(operands[outs[i]].buffer); in executeOperation()
1447 const RunTimeOperandInfo& in1 = operands[ins[0]]; in executeOperation()
1448 const RunTimeOperandInfo& in2 = operands[ins[1]]; in executeOperation()
1450 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1464 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1465 const RunTimeOperandInfo& filter = operands[ins[1]]; in executeOperation()
1466 const RunTimeOperandInfo& bias = operands[ins[2]]; in executeOperation()
1477 padding_left = getScalarData<int32_t>(operands[ins[3]]); in executeOperation()
1478 padding_right = getScalarData<int32_t>(operands[ins[4]]); in executeOperation()
1479 padding_top = getScalarData<int32_t>(operands[ins[5]]); in executeOperation()
1480 padding_bottom = getScalarData<int32_t>(operands[ins[6]]); in executeOperation()
1481 stride_width = getScalarData<int32_t>(operands[ins[7]]); in executeOperation()
1482 stride_height = getScalarData<int32_t>(operands[ins[8]]); in executeOperation()
1483 numGroups = getScalarData<int32_t>(operands[ins[9]]); in executeOperation()
1484 activation = getScalarData<int32_t>(operands[ins[10]]); in executeOperation()
1485 data_layout = getScalarData<bool>(operands[ins[11]]); in executeOperation()
1487 padding_implicit = getScalarData<int32_t>(operands[ins[3]]); in executeOperation()
1488 stride_width = getScalarData<int32_t>(operands[ins[4]]); in executeOperation()
1489 stride_height = getScalarData<int32_t>(operands[ins[5]]); in executeOperation()
1490 numGroups = getScalarData<int32_t>(operands[ins[6]]); in executeOperation()
1491 activation = getScalarData<int32_t>(operands[ins[7]]); in executeOperation()
1492 data_layout = getScalarData<bool>(operands[ins[8]]); in executeOperation()
1495 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1600 const RunTimeOperandInfo& input = operands[ins[0]]; in executeOperation()
1601 const RunTimeOperandInfo& multiples = operands[ins[1]]; in executeOperation()
1603 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1620 operands[outs[QuantizedLSTMCell::kCellStateOutTensor]]; in executeOperation()
1621 RunTimeOperandInfo& output = operands[outs[QuantizedLSTMCell::kOutputTensor]]; in executeOperation()
1624 QuantizedLSTMCell quantizedLSTMCell(operation, operands); in executeOperation()
1626 success = QuantizedLSTMCell::prepare(operation, operands, &cellStateOutShape, in executeOperation()
1636 const RunTimeOperandInfo& base = operands[ins[0]]; in executeOperation()
1637 const RunTimeOperandInfo& exponent = operands[ins[1]]; in executeOperation()
1639 RunTimeOperandInfo& output = operands[outs[0]]; in executeOperation()
1656 OperationExecutionContext context(&operation, operands); in executeOperation()
1674 consumeOperationInputs(ins, operands); in executeOperation()
1692 int CpuExecutor::executeIfOperation(const Operation& operation, RunTimeOperandInfo* operands) { in executeIfOperation() argument
1694 const RunTimeOperandInfo& condOperand = operands[operation.inputs[op::kCondBoolOperand]]; in executeIfOperation()
1703 const RunTimeOperandInfo& branchOperand = operands[operation.inputs[branchInputIndex]]; in executeIfOperation()
1711 operands[operation.inputs[op::kFirstInput + i]]); in executeIfOperation()
1715 operands[operation.outputs[i]]); in executeIfOperation()
1723 setInfoExceptLifetime(&operands[operation.outputs[i]], in executeIfOperation()
1727 consumeOperationInputs(operation.inputs, operands); in executeIfOperation()
1731 int CpuExecutor::executeWhileOperation(const Operation& operation, RunTimeOperandInfo* operands) { in executeWhileOperation() argument
1733 const RunTimeOperandInfo& condModelOperand = operands[operation.inputs[op::kCondModelOperand]]; in executeWhileOperation()
1734 const RunTimeOperandInfo& bodyModelOperand = operands[operation.inputs[op::kBodyModelOperand]]; in executeWhileOperation()
1755 [&tmp1, &tmp2, &condOperands, &bodyOperands, &operation, &operands] { in executeWhileOperation()
1768 consumeOperationInputs(operation.inputs, operands); in executeWhileOperation()
1776 const Operand& operand = bodySubgraph.operands[bodySubgraph.outputIndexes[i]]; in executeWhileOperation()
1783 operands[operation.inputs[op::kFirstInput + i]]); in executeWhileOperation()
1828 info.dimensions = bodySubgraph.operands[bodySubgraph.outputIndexes[i]].dimensions; in executeWhileOperation()
1847 RunTimeOperandInfo& outerOperand = operands[operation.outputs[i]]; in executeWhileOperation()
1861 const std::vector<RunTimeOperandInfo>& operands) { in setOutputShapes() argument
1865 const RunTimeOperandInfo& from = operands[operandIndex]; in setOutputShapes()