Commit 898ee241 by xiaotong

add NewTensor() to generate an empty XTensor

parent 04412ff1
......@@ -2064,6 +2064,13 @@ void InitTensor(XTensor * tensor, const XTensor * reference)
reference->dataType, reference->denseRatio,
reference->devID, reference->mem);
}
/* generate a XTensor with no initialization */
XTensor * NewTensor()
{
XTensor * tensor = new XTensor();
return tensor;
}
/*
generate a XTensor
......
......@@ -438,6 +438,9 @@ void InitTensor5D(XTensor * tensor, const int d0, const int d1, const int d2, co
/* initialize a tensor with a reference tensor */
void InitTensor(XTensor * tensor, const XTensor * reference);
/* generate a XTensor with no initialization */
XTensor * NewTensor();
/* generate a XTensor */
XTensor * NewTensor(const int myOrder, const int * myDimSize, const TENSOR_DATA_TYPE myDataType = X_FLOAT,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论