We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65efde8 commit 4ad39d8Copy full SHA for 4ad39d8
include/af/autograd/Variable.hpp
@@ -60,6 +60,8 @@ namespace af {
60
61
bool isGradAvailable() const;
62
63
+ af::dim4 dims() const;
64
+
65
void zeroGrad();
66
67
void setCalcGrad(bool calc_grad);
src/autograd/Variable.cpp
@@ -102,6 +102,11 @@ namespace af {
102
return m_shared->m_grads.size() >= 1;
103
}
104
105
+ af::dim4 Variable::dims() const
106
+ {
107
+ return m_shared->m_data.dims();
108
+ }
109
110
void Variable::zeroGrad()
111
{
112
m_shared->m_grads.clear();
0 commit comments