Skip to content

Commit 4ad39d8

Browse files
pavankyumar456
authored andcommitted
Adding Variable::dims()
1 parent 65efde8 commit 4ad39d8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/af/autograd/Variable.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ namespace af {
6060

6161
bool isGradAvailable() const;
6262

63+
af::dim4 dims() const;
64+
6365
void zeroGrad();
6466

6567
void setCalcGrad(bool calc_grad);

src/autograd/Variable.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ namespace af {
102102
return m_shared->m_grads.size() >= 1;
103103
}
104104

105+
af::dim4 Variable::dims() const
106+
{
107+
return m_shared->m_data.dims();
108+
}
109+
105110
void Variable::zeroGrad()
106111
{
107112
m_shared->m_grads.clear();

0 commit comments

Comments
 (0)