This commit implements Model_addOperand.
It has dependency on #195.
If #195 is landed, it would work well.
Signed-off-by: sjsujinkim <sjsujin.kim@samsung.com>
LOG(INFO) << "operandValues size" << model.operandValues.size();
LOG(INFO) << "pools" << toString(model.pools);
}
-
+#endif // REF-ANN
// Validates the type. The used dimensions can be underspecified.
int validateOperandType(const ANeuralNetworksOperandType& type, const char* tag,
bool allowPartial) {
}
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++) {
#ifndef ANDROID_ML_NN_COMMON_UTILS_H
#define ANDROID_ML_NN_COMMON_UTILS_H
-#if 0 // REF-ANN
#include "HalInterfaces.h"
-#endif
#include "NeuralNetworks.h"
#include "Log.h"
// Does a detailed LOG(INFO) of the model
void logModelToInfo(const Model& model);
-
+#endif // REF-ANN
inline void setFromIntList(hidl_vec<uint32_t>* vec, uint32_t count, const uint32_t* data) {
vec->resize(count);
for (uint32_t i = 0; i < count; i++) {
(*vec)[i] = data[i];
}
}
-
+#if 0 // REF-ANN
inline std::string toString(uint32_t obj) {
return std::to_string(obj);
}
}
return os += "]";
}
-
+#endif // REF-ANN
inline bool validCode(uint32_t codeCount, uint32_t codeCountOEM, uint32_t code) {
return (code < codeCount) || (code >= kOEMCodeBase && (code - kOEMCodeBase) < codeCountOEM);
}
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);
bool validateModel(const Model& model);
file(GLOB SRCS *.cc)
add_executable(runtime_run ${SRCS})
-target_link_libraries(runtime_run runtime)
+target_link_libraries(runtime_run runtime runtime_ref_common)
#include "CompilationBuilder.h"
-#include "Log.h"
-
#if 0
#define LOG_TAG "ModelBuilder"
namespace nn {
// The maximum number of operands and operations that a model may have.
-#if 0
const uint32_t MAX_NUMBER_OF_OPERANDS = 0xFFFFFFFE;
const uint32_t MAX_NUMBER_OF_OPERATIONS = 0xFFFFFFFE;
-#endif
int ModelBuilder::addOperand(const ANeuralNetworksOperandType& type) {
- // Dummy Implementation
- return 0;
-
-#if 0
if (mCompletedModel) {
LOG(ERROR) << "ANeuralNetworksModel_addOperand can't modify after model finished";
return ANEURALNETWORKS_BAD_DATA;
operand.lifetime = OperandLifeTime::TEMPORARY_VARIABLE;
operand.location = {.poolIndex = 0, .offset = 0, .length = 0};
return ANEURALNETWORKS_NO_ERROR;
-#endif
}
int ModelBuilder::setOperandValue(uint32_t index, const void* buffer, size_t length) {
int ANeuralNetworksModel_addOperand(ANeuralNetworksModel* model,
const ANeuralNetworksOperandType* type) {
- // Dummy Implementation
- return ANEURALNETWORKS_NO_ERROR;
-
- // Original code for reference
-#if 0
if (!model || !type) {
LOG(ERROR) << "ANeuralNetworksModel_addOperand passed a nullptr";
return ANEURALNETWORKS_UNEXPECTED_NULL;
}
ModelBuilder* m = reinterpret_cast<ModelBuilder*>(model);
return m->addOperand(*type);
-#endif
}
int ANeuralNetworksModel_setOperandValue(ANeuralNetworksModel* model, int32_t index,