Skip to content
Snippets Groups Projects

Scheduler backprop

Merged Maxence Naud requested to merge scheduler_backprop into dev
1 file
+ 25
0
Compare changes
  • Side-by-side
  • Inline
@@ -20,6 +20,7 @@
#include "aidge/scheduler/Scheduler.hpp"
#include "aidge/backend/cpu.hpp"
#include "aidge/recipies/GraphViewHelper.hpp"
using namespace Aidge;
@@ -206,4 +207,28 @@ TEST_CASE("[cpu/scheduler] SequentialScheduler(forward)") {
}
SECTION("Test Recurrent graph") {}
}
TEST_CASE("[cpu/scheduler] SequentialScheduler(backward)", "[scheduler][backward]") {
std::shared_ptr<GraphView> gv = Sequential({ReLU(), ReLU()});
std::shared_ptr<Tensor> inputTensor =
std::make_shared<Tensor>(Array4D<int, 2, 1, 5, 5>{{{{{0, 1, 2, 3, 4},
{5, 6, 7, 8, 9},
{10, 11, 12, 13, 14},
{15, 16, 17, 18, 19},
{20, 21, 22, 23, 24}}},
{{{25, 26, 27, 28, 29},
{30, 31, 32, 33, 34},
{35, 36, 37, 38, 39},
{40, 41, 42, 43, 44},
{45, 46, 47, 48, 49}}}}});
auto label = inputTensor;
// implem already set to default
auto myProd = Producer(inputTensor, "prod");
myProd -> addChild(gv);
gv -> compile("cpu", DataType::Float32);
compile_gradient(gv);
SequentialScheduler scheduler(gv);
scheduler.backward();
}
\ No newline at end of file
Loading