TensorDim(std::initializer_list<unsigned int> dims);
/**
+ * @brief Construct a new Tensor Dim object without batch dimension
+ *
+ * @param shapes shapes without batch dimension
+ */
+ TensorDim(const std::array<unsigned int, 3> &shapes);
+
+ /**
* @brief Construct a new Tensor Dim object
*
* @param b batch
"one label detected, num labels: "
<< num_label;
+ /// @todo implement and use getLabel(0) instead.
label_list.push_back(node->getOutputGrad(0).getName());
label_dims.push_back(node->getOutputDimensions()[0]);
};
auto identify_external_tensors = [this](const std::vector<std::string> &names,
auto &&pred, auto &&identify) {
if (names.empty()) {
- std::vector<nntrainer::TensorDim> old_dims;
for (unsigned int i = 0; i < graph.size(); ++i) {
auto lnode = getSortedLayerNode(i).get();
if (!pred(lnode)) {
* @param model_input_names model input names if empty list given, all of node
* that can be inputs will be identified in the sort order
* @param model_label_names model label names if empty list given, all of node
- * that can be inputs will be identified in the sort order
+ * that can be labels will be identified in the sort order
* @return int ML_ERROR_NONE if successful
*/
int initialize(const std::vector<std::string> &model_input_names = {},
at the start of the graph */
bool compiled; /**< if the model graph is compiled */
unsigned int batch_size; /**< current batch_size */
- // std::vector<Var_Grad *> label_list; /**< var_grads for the labels */
- // std::vector<Var_Grad *> input_list; /**< var_grads for the inputs */
+
+ /// @note *_list and *_dims must be synced at all times. Consider put it as a
+ /// structure
std::vector<std::string> label_list; /**< identifier for the model labels */
std::vector<std::string> input_list; /**< identifier for the model inputs */
std::vector<TensorDim> label_dims; /**< graph label dimensions */
}
}
+TensorDim::TensorDim(const std::array<unsigned int, 3> &shapes) :
+ TensorDim({shapes[0], shapes[1], shapes[2]}) {}
+
TensorDim::TensorDim(unsigned int b, unsigned int c, unsigned int h,
unsigned int w, const std::bitset<MAXDIM> &eff_dim_flag_,
const std::bitset<MAXDIM> &dyn_dim_flag_) :
%{_includedir}/nntrainer/optimizer_impl.h
%{_libdir}/pkgconfig/nntrainer.pc
# update this to enable external applications
-# @todo filter out headers that should be hidden
+# @todo filter out headers that should be hidden, and classifiy in the appropriate place if not
%{_includedir}/nntrainer/util_func.h
%files devel-static