mirror of
https://github.com/marian-nmt/marian.git
synced 2024-09-11 06:15:56 +03:00
in loop
This commit is contained in:
parent
ad853351cc
commit
437863be38
@ -11,6 +11,7 @@ int main(int argc, char** argv) {
|
|||||||
size_t max = rand() % 20 + 1;
|
size_t max = rand() % 20 + 1;
|
||||||
|
|
||||||
Var x0 = 1, x1 = 2, x2 = 3;
|
Var x0 = 1, x1 = 2, x2 = 3;
|
||||||
|
std::vector<Var> x = { x0, x1, x2 };
|
||||||
|
|
||||||
Var y = 0.0;
|
Var y = 0.0;
|
||||||
for(int i = 0; i < max; i++) {
|
for(int i = 0; i < max; i++) {
|
||||||
@ -19,7 +20,6 @@ int main(int argc, char** argv) {
|
|||||||
x.push_back(xi);
|
x.push_back(xi);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Var> x = { x0, x1, x2 };
|
|
||||||
|
|
||||||
set_zero_all_adjoints();
|
set_zero_all_adjoints();
|
||||||
y.grad();
|
y.grad();
|
||||||
|
Loading…
Reference in New Issue
Block a user