Commit d9e3bea4 by xiaotong

define NULLTensor and NULLList

parent 174ed699
......@@ -81,15 +81,14 @@ void SmallTest()
a.Set2D(1.0F, 0, 0);
a.Set2D(2.0F, 1, 1);
//b = Sum(a, Multiply(a, a));
b = Sum(a, Multiply(a, a));
/* cannot write this !!!!!!!!!!!!! */
/* this is prohibited !!!!!!!!!!!!! */
//XTensor c = a * b + a;
//XTensor d = a + b + c.Lin(0.5F);
c = a * b + a;
d = a + b + c.Lin(0.5F);
//d = a + b * b;
XLink::CheckNetwork(&d);
XLink::ShowNetwork(stderr, &d);
......
......@@ -42,6 +42,8 @@
/* the nts (NiuTrans.Tensor) namespace */
namespace nts{
XList NULLList;
/* constructor */
XList::XList()
{
......
......@@ -96,6 +96,8 @@ public:
};
extern XList NULLList;
}
/* end of the nts (NiuTrans.Tensor) namespace */
......
......@@ -61,7 +61,7 @@ namespace nts{
int tensorIDGlobal = 0;
MUTEX_HANDLE tensorMutex;
XTensor firstTensor;
XTensor NULLTensor;
/* generate a tensor id */
int MakeTensorID()
......
......@@ -334,7 +334,7 @@ public:
/* we make a unique id for every tensor */
extern int tensorIDGlobal;
extern MUTEX_HANDLE tensorMutex;
extern XTensor firstTensor;
extern XTensor NULLTensor;
extern int MakeTensorID();
/************************************************
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论