return std::make_unique<LayerNode>(createLayer(type));
}
+std::ostream &operator<<(std::ostream &out, const LayerNode &l) {
+ out << "[" << l.getName() << '/' << l.getType() << "]\n";
+ auto print_vector = [&out](const std::vector<std::string> &layers,
+ const std::string &title) {
+ out << title << "[" << layers.size() << "] ";
+ for (auto &layer : layers) {
+ out << layer << ' ';
+ }
+ out << '\n';
+ };
+
+ print_vector(l.input_layers, " input_layers");
+ print_vector(l.output_layers, "output_layers");
+ /// comment intended here,
+ // print_vector(l.getObject()->input_layers, " input_layers");
+ // print_vector(l.getObject()->output_layers, "output_layers");
+ return out;
+}
+
}; // namespace nntrainer
* @note This name might be changed once this layer is added to the model
* to keep the name unique to the model
*/
+ const std::string getName() const noexcept { return layer->getName(); }
+
+ /**
+ * @brief Get name of the layer
+ *
+ * @retval name of the layer
+ * @note This name is unique to this layer in a model
+ * @note This name might be changed once this layer is added to the model
+ * to keep the name unique to the model
+ */
std::string getName() noexcept { return layer->getName(); }
/**
int event_key;
#endif
+ /**
+ * @brief Overriding output stream for layers and it's derived class
+ */
+ friend std::ostream &operator<<(std::ostream &out, const LayerNode &l);
+
private:
// TODO: make this unique_ptr once getObject API is removed
std::shared_ptr<nntrainer::Layer>