diff --git a/unit_tests/operator/Test_ReshapeImpl.cpp b/unit_tests/operator/Test_ReshapeImpl.cpp index 5d28005eb40534742aae495948e5269373b81ad1..2f374732d5757d1fdd036c26d039bea71499659f 100644 --- a/unit_tests/operator/Test_ReshapeImpl.cpp +++ b/unit_tests/operator/Test_ReshapeImpl.cpp @@ -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();