This commits Model_addOperation and enables below helpers.
- setFromIntList
- validCode
Signed-off-by: sjsujinkim <sjsujin.kim@samsung.com>
}
return ANEURALNETWORKS_NO_ERROR;
}
-#if 0 // REF-ANN
+
int validateOperandList(uint32_t count, const uint32_t* list, uint32_t operandCount,
const char* tag) {
for (uint32_t i = 0; i < count; i++) {
}
return ANEURALNETWORKS_NO_ERROR;
}
-
+#if 0 // REF-ANN
static bool validOperandIndexes(const hidl_vec<uint32_t> indexes, size_t operandCount) {
for (uint32_t i : indexes) {
if (i >= operandCount) {
}
int validateOperandType(const ANeuralNetworksOperandType& type, const char* tag, bool allowPartial);
-#if 0 // REF-ANN
int validateOperandList(uint32_t count, const uint32_t* list, uint32_t operandCount,
const char* tag);
+#if 0 // REF-ANN
bool validateModel(const Model& model);
bool validateRequest(const Request& request, const Model& model);
#endif // REF-ANN
int ModelBuilder::addOperation(ANeuralNetworksOperationType type, uint32_t inputCount,
const uint32_t* inputs, uint32_t outputCount,
const uint32_t* outputs) {
- // Dummy Implementation
- return 0;
-#if 0
if (mCompletedModel) {
LOG(ERROR) << "ANeuralNetworksModel_addOperation can't modify after model finished";
return ANEURALNETWORKS_BAD_DATA;
// TODO mOperands[i].consumers.push_back(operationIndex);
}
return ANEURALNETWORKS_NO_ERROR;
-#endif
}
int ModelBuilder::identifyInputsAndOutputs(uint32_t inputCount, const uint32_t* inputs,
ANeuralNetworksOperationType type, uint32_t inputCount,
const uint32_t* inputs, uint32_t outputCount,
const uint32_t* outputs) {
- // Dummy Implementation
- return ANEURALNETWORKS_NO_ERROR;
-
- // Original code for reference
-#if 0
if (!model || !inputs || !outputs) {
LOG(ERROR) << "ANeuralNetworksModel_addOperation passed a nullptr";
return ANEURALNETWORKS_UNEXPECTED_NULL;
}
ModelBuilder* m = reinterpret_cast<ModelBuilder*>(model);
return m->addOperation(type, inputCount, inputs, outputCount, outputs);
-#endif
}
int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel* model, uint32_t inputCount,