Commit 6c15668f by xuchen

add the annotation

parent b767f2f6
......@@ -26,10 +26,10 @@
namespace nts { // namespace nts(NiuTrans.Tensor)
/* transform a tensor by merging it alone with a dimension, e.g., (M, N/3, 3) -> (M, N) */
/* transform a tensor by merging it along with a dimension, e.g., (M, N/3, 3) -> (M, N) */
void _Merge(const XTensor * s, XTensor * t, int whereToMerge, int leadingDim = -1);
/* transform a tensor by merging it alone with a dimension (return an XTensor structure)
/* transform a tensor by merging it along with a dimension (return an XTensor structure)
e.g., (M, N/3, 3) -> (M, N) */
XTensor Merge(const XTensor &s, int whereToMerge, int leadingDim = -1);
......
......@@ -167,6 +167,16 @@ XTensor Unsqueeze(const XTensor &a, int dim, int dSize)
return b;
}
/*
insert a dimension by copying the blocks for x times
(where x is the size of the inerted dimension) (returna a XTensor structure)
make a new tensor to keep the result and return it
>> a - the input tensor
>> b - the output tensor
>> dim - where to insert the dimension
>> dSize - size of the newly-inserted dimension
*/
void Unsqueeze(const XTensor &a, XTensor &b, int dim, int dSize)
{
if (!b.isInit || !CheckUnsqueezeSize(&a, &b, dim, dSize)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论