Closed gray-heron closed 5 years ago
Hello, I found that the following code:
adept::Stack main_stack; adept::FixedArray<adept::Real, true, 2> v({2, 3}); main_stack.new_recording(); adept::aReal r = adept::sum(v); r.set_gradient(1.0); main_stack.reverse(); std::cerr << v.get_gradient();
throws at _v.getgradient():
terminate called after throwing an instance of 'adept::gradient_out_of_range' what(): Gradient index out of range: probably aReal objects have been created after a set_gradient(s) call
If I substitute the first line with:
adept::FixedArray<adept::Real, true, 2, 2> v({{2, 3}, {2, 3}});
then it all works well.
Am I doing something wrong? This happens to me on Linux both with GCC 5.4.0 and Clang 6.0.
Bug. Latest commit should fix - please let me know. Thanks!
Yes, it works fine now. Thank you.
Hello, I found that the following code:
throws at _v.getgradient():
If I substitute the first line with:
then it all works well.
Am I doing something wrong? This happens to me on Linux both with GCC 5.4.0 and Clang 6.0.