Skip to content
Snippets Groups Projects
Commit 50a8f938 authored by Maxence Naud's avatar Maxence Naud
Browse files

[Fix] do not use initializer_list to initialize array anymore in operators factories

parent 365bb132
No related branches found
No related tags found
1 merge request!25[Fix] do not use initializer_list to initialize array anymore in operators factories
Pipeline #32746 passed
...@@ -196,7 +196,7 @@ inline std::shared_ptr<Node> Conv(DimSize_t in_channels, ...@@ -196,7 +196,7 @@ inline std::shared_ptr<Node> Conv(DimSize_t in_channels,
auto conv = std::make_shared<Node>(std::make_shared<Conv_Op<static_cast<DimIdx_t>(DIM)>>(in_channels, out_channels, kernel_dims, stride_dims, padding_dims, dilation_dims), name); auto conv = std::make_shared<Node>(std::make_shared<Conv_Op<static_cast<DimIdx_t>(DIM)>>(in_channels, out_channels, kernel_dims, stride_dims, padding_dims, dilation_dims), name);
// addProducer(conv, 1, append(append(kernel_dims, in_channels), out_channels), "w"); // addProducer(conv, 1, append(append(kernel_dims, in_channels), out_channels), "w");
addProducer(conv, 1, append(out_channels, append(in_channels, kernel_dims)), "w"); addProducer(conv, 1, append(out_channels, append(in_channels, kernel_dims)), "w");
addProducer(conv, 2, {out_channels}, "b"); addProducer(conv, 2, std::array<DimSize_t, 1>({out_channels}), "b");
return conv; return conv;
} }
......
...@@ -163,8 +163,8 @@ public: ...@@ -163,8 +163,8 @@ public:
inline std::shared_ptr<Node> FC(DimSize_t out_channels, bool noBias = false, const std::string& name = "") { inline std::shared_ptr<Node> FC(DimSize_t out_channels, bool noBias = false, const std::string& name = "") {
// FIXME: properly handle default w&b initialization in every cases // FIXME: properly handle default w&b initialization in every cases
auto fc = std::make_shared<Node>(std::make_shared<FC_Op>(out_channels, noBias), name); auto fc = std::make_shared<Node>(std::make_shared<FC_Op>(out_channels, noBias), name);
addProducer(fc, 1, {out_channels, 1}, "w"); addProducer(fc, 1, std::array<DimSize_t, 2>({out_channels, 1}), "w");
addProducer(fc, 2, {(noBias ? 0 : out_channels)}, "b"); // already sets bias dims addProducer(fc, 2, (noBias ? std::array<DimSize_t, 1>({0}) : std::array<DimSize_t, 1>({out_channels})), "b"); // already sets bias dims
return fc; return fc;
} }
} // namespace Aidge } // namespace Aidge
......
...@@ -153,7 +153,7 @@ public: ...@@ -153,7 +153,7 @@ public:
inline std::shared_ptr<Node> MatMul(DimSize_t out_channels, const std::string& name = "") { inline std::shared_ptr<Node> MatMul(DimSize_t out_channels, const std::string& name = "") {
// FIXME: properly handle default w initialization in every cases // FIXME: properly handle default w initialization in every cases
auto matmul = std::make_shared<Node>(std::make_shared<MatMul_Op>(out_channels), name); auto matmul = std::make_shared<Node>(std::make_shared<MatMul_Op>(out_channels), name);
addProducer(matmul, 1, {out_channels, 1}, "w"); addProducer(matmul, 1, std::array<DimSize_t, 2>({out_channels, 1}), "w");
return matmul; return matmul;
} }
} // namespace Aidge } // namespace Aidge
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment