The second argument of tensor_dtype is used as std::regex(string).
But it didn't include handling for std::regex_error. created a getRegex()
function because it is used in a similar form in other codes. The
getRegex() function takes a string and retrun a std::regex object.
Signed-off-by: SeoHyungjun <hyungjun.seo@samsung.com>
subdir('YOLO/jni')
subdir('ReinforcementLearning/DeepQ/jni')
subdir('TransferLearning/CIFAR_Classification/jni')
-if enable_capi
- subdir('TransferLearning/Draw_Classification/jni')
-endif
+# if enable_capi
+# subdir('TransferLearning/Draw_Classification/jni')
+# endif
subdir('Custom')
subdir('ProductRatings/jni')
subdir('AlexNet/jni')
optimize_memory(true),
exec_mode(ExecutionMode::TRAIN),
tensor_format("NCHW"),
- tensor_dtype(split("FP32-FP32", std::regex("\\-"))) {}
+ tensor_dtype(split("FP32-FP32", getRegex("\\-"))) {}
/**
* @brief Constructor of NeuralNetwork Graph Class
optimize_memory(true),
exec_mode(ExecutionMode::TRAIN),
tensor_format(tensor_format_),
- tensor_dtype(split(tensor_dtype_, std::regex("\\-"))) {}
+ tensor_dtype(split(tensor_dtype_, getRegex("\\-"))) {}
/**
* @brief Destructor of the NeuralNetwork Graph class
__fp16 x = alpha * X[i];
for (unsigned int j = 0; j < cols; j += 8) {
- __fp16 *__restrict y = &Y[j];
-
- float16x8_t y0_7 = vld1q_f16(&Y[j]);
- float16x8_t wvec0_7 = vld1q_f16(&A[i * cols + j]);
-
- y0_7 = vfmaq_n_f16(y0_7, wvec0_7, x);
-
- float16x8_t wvec0_7;
- const __fp16 *__restrict w;
-
- w = &A[i * cols + j];
float16x8_t y0_7 = vld1q_f16(&Y[j]);
float16x8_t wvec0_7 = vld1q_f16(&A[i * cols + j]);
enable_optimizations(true),
swap_lookahead(0),
tensor_format("NCHW"),
- tensor_dtype(split("FP32-FP32", std::regex("\\-"))) {}
+ tensor_dtype(split("FP32-FP32", getRegex("\\-"))) {}
/**
* @brief Constructor of Manager
enable_optimizations(true),
swap_lookahead(lookahead),
tensor_format(tensor_format_),
- tensor_dtype(split(tensor_dtype_, std::regex("\\-"))) {}
+ tensor_dtype(split(tensor_dtype_, getRegex("\\-"))) {}
/**
* @brief Construct a new Manager object (deleted)
str.erase(std::remove(str.begin(), str.end(), char_to_remove[i]),
str.end());
}
+
std::regex_token_iterator<std::string::iterator> end;
std::regex_token_iterator<std::string::iterator> iter(str.begin(), str.end(),
reg, -1);
#endif
}
+std::regex getRegex(const std::string &str) {
+ std::regex result;
+
+ try {
+ result = std::regex(str);
+ } catch (const std::regex_error &e) {
+ ml_loge("regex_error caught: %s", e.what());
+ }
+
+ return result;
+}
+
} // namespace nntrainer
*/
tm *getLocaltime(tm *tp);
+/**
+ * @brief Create and return std::regex with the received string
+ * @param str String in regular expression form
+ * @return std::regex
+ */
+std::regex getRegex(const std::string &str);
+
} /* namespace nntrainer */
#endif /* __cplusplus */