Skip to content
Snippets Groups Projects
Commit 0fef5757 authored by Houssem ROUIS's avatar Houssem ROUIS Committed by Maxence Naud
Browse files

fix ReshapeImpl test

parent d4917132
No related branches found
No related tags found
2 merge requests!152Update Aidge export to take a graph view has an argument instead of a...,!111Fix Reshape
This commit is part of merge request !111. Comments created here will be created in the context of that merge request.
......@@ -23,6 +23,9 @@ TEST_CASE("[cpu/operator] Reshape(forward)") {
std::shared_ptr<Tensor> input = std::make_shared<Tensor>(Array1D<float,6> {
{1.0, 2.0, 3.0, 4.0, 5.0, 6.0}
});
std::shared_ptr<Tensor> shape = std::make_shared<Tensor>(Array1D<float,2> {
{2, 3}
});
std::shared_ptr<Tensor> expectedOutput = std::make_shared<Tensor>(Array2D<float,2,3> {
{
{1.0, 2.0, 3.0},
......@@ -30,9 +33,10 @@ TEST_CASE("[cpu/operator] Reshape(forward)") {
}
});
std::shared_ptr<Node> myReshape = Reshape({2, 3});
std::shared_ptr<Node> myReshape = Reshape();
auto op = std::static_pointer_cast<OperatorTensor>(myReshape -> getOperator());
op->associateInput(0, input);
op->associateInput(1, shape);
op->setDataType(DataType::Float32);
op->setBackend("cpu");
myReshape->forward();
......@@ -47,6 +51,9 @@ TEST_CASE("[cpu/operator] Reshape(forward)") {
}
});
std::shared_ptr<Tensor> shape = std::make_shared<Tensor>(Array1D<float,2> {
{3, 2}
});
std::shared_ptr<Tensor> expectedOutput = std::make_shared<Tensor>(Array2D<float,3,2> {
{
{1.0, 2.0},
......@@ -55,9 +62,10 @@ TEST_CASE("[cpu/operator] Reshape(forward)") {
}
});
std::shared_ptr<Node> myReshape = Reshape({3, 2});
std::shared_ptr<Node> myReshape = Reshape();
auto op = std::static_pointer_cast<OperatorTensor>(myReshape -> getOperator());
op->associateInput(0, input);
op->associateInput(1, shape);
op->setDataType(DataType::Float32);
op->setBackend("cpu");
myReshape->forward();
......
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