Skip to content
Snippets Groups Projects
Commit 4b840ec7 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Merge branch 'fix/initializerlist_array' into 'main'

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

See merge request !25
parents 0921c777 50a8f938
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 #32781 passed
......@@ -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);
// 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, 2, {out_channels}, "b");
addProducer(conv, 2, std::array<DimSize_t, 1>({out_channels}), "b");
return conv;
}
......
......@@ -163,8 +163,8 @@ public:
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
auto fc = std::make_shared<Node>(std::make_shared<FC_Op>(out_channels, noBias), name);
addProducer(fc, 1, {out_channels, 1}, "w");
addProducer(fc, 2, {(noBias ? 0 : out_channels)}, "b"); // already sets bias dims
addProducer(fc, 1, std::array<DimSize_t, 2>({out_channels, 1}), "w");
addProducer(fc, 2, (noBias ? std::array<DimSize_t, 1>({0}) : std::array<DimSize_t, 1>({out_channels})), "b"); // already sets bias dims
return fc;
}
} // namespace Aidge
......
......@@ -153,7 +153,7 @@ public:
inline std::shared_ptr<Node> MatMul(DimSize_t out_channels, const std::string& name = "") {
// FIXME: properly handle default w initialization in every cases
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;
}
} // 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