refactor: isolate layer inputs from layers
This commit is contained in:
+5
-3
@@ -15,7 +15,9 @@ enum class layer_type {
|
|||||||
Dense,
|
Dense,
|
||||||
};
|
};
|
||||||
|
|
||||||
class layer_input {};
|
struct layer_input {
|
||||||
|
static constexpr std::uint32_t DENSE_TAG = 0x444E5345;
|
||||||
|
};
|
||||||
|
|
||||||
template <std::size_t Features>
|
template <std::size_t Features>
|
||||||
class dense_input : public layer_input {
|
class dense_input : public layer_input {
|
||||||
@@ -25,7 +27,7 @@ class dense_input : public layer_input {
|
|||||||
friend class layer_info;
|
friend class layer_info;
|
||||||
private:
|
private:
|
||||||
struct inner final {
|
struct inner final {
|
||||||
static constexpr layer_type TYPE = layer_type::Dense;
|
static constexpr std::uint32_t TAG = DENSE_TAG;
|
||||||
|
|
||||||
static constexpr std::size_t FEATURES = Features;
|
static constexpr std::size_t FEATURES = Features;
|
||||||
|
|
||||||
@@ -71,7 +73,7 @@ private:
|
|||||||
static constexpr layer_type TYPE = layer_type::Dense;
|
static constexpr layer_type TYPE = layer_type::Dense;
|
||||||
|
|
||||||
using input_type = input_type_s<NN, I>::type;
|
using input_type = input_type_s<NN, I>::type;
|
||||||
static_assert(input_type::TYPE == layer_type::Dense);
|
static_assert(input_type::TAG == layer_input::DENSE_TAG);
|
||||||
|
|
||||||
using output_type = input_inner_t<dense_input<Features>>;
|
using output_type = input_inner_t<dense_input<Features>>;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user