Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
NiuTrans.Tensor
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
杨迪
NiuTrans.Tensor
Commits
dc56fd67
Commit
dc56fd67
authored
Nov 28, 2018
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean useless code
parent
49869ae5
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
6 行增加
和
22 行删除
+6
-22
source/sample/transformer/T2TTrainer.cpp
+4
-14
source/tensor/core/movement/Gather.cpp
+1
-4
source/tensor/core/movement/Spread.cpp
+1
-4
没有找到文件。
source/sample/transformer/T2TTrainer.cpp
查看文件 @
dc56fd67
...
...
@@ -870,7 +870,6 @@ int T2TTrainer::LoadBatchMT(FILE * file,
int
sCount
=
sc
/
2
;
int
seqSize
=
0
;
int
dimsEnc
[
3
]
=
{
sCount
,
maxEnc
,
vsEnc
};
int
dimsDec
[
3
]
=
{
sCount
,
maxDec
,
vsDec
};
InitTensor2D
(
batchEnc
,
sCount
,
maxEnc
,
X_INT
,
devID
,
mem
);
...
...
@@ -900,8 +899,6 @@ int T2TTrainer::LoadBatchMT(FILE * file,
int
len
=
seqLen
[
s
];
int
sent
=
(
s
-
seq
)
/
2
;
for
(
int
w
=
0
;
w
<
len
;
w
++
){
//batchEnc->Set2DInt(buf[seqOffset[s] + w], sent, w);
//paddingEnc->Set2D(1.0F, sent, w);
int
num
=
buf
[
seqOffset
[
s
]
+
w
];
batchEncOffsets
[
wCount
]
=
batchEnc
->
GetOffset2D
(
sent
,
w
);
...
...
@@ -923,27 +920,20 @@ int T2TTrainer::LoadBatchMT(FILE * file,
CheckNTErrors
(
len
<=
maxDec
,
"Something is wrong!"
);
int
sent
=
(
s
-
seq
-
1
)
/
2
;
for
(
int
w
=
0
;
w
<
len
;
w
++
){
//batchDec->Set2DInt(buf[seqOffset[s] + w], sent, w);
//paddingDec->Set2D(1.0F, sent, w);
int
num
=
buf
[
seqOffset
[
s
]
+
w
];
batchDecOffsets
[
wCountDec
]
=
batchDec
->
GetOffset2D
(
sent
,
w
);
batchDecValues
[
wCountDec
]
=
num
;
paddingDecOffsets
[
wCountDec
]
=
paddingDec
->
GetOffset2D
(
sent
,
w
);
if
(
w
>
0
)
{
//gold->Set3D(1.0F, sent, w - 1, buf[seqOffset[s] + w]);
if
(
w
>
0
)
goldOffsets
[
wGold
++
]
=
gold
->
GetOffset3D
(
sent
,
w
-
1
,
buf
[
seqOffset
[
s
]
+
w
]);
}
if
(
w
==
len
-
1
)
{
if
(
isDoubledEnd
)
{
//gold->Set3D(1.0F, sent, w, buf[seqOffset[s] + w]);
if
(
isDoubledEnd
)
goldOffsets
[
wGold
++
]
=
gold
->
GetOffset3D
(
sent
,
w
,
buf
[
seqOffset
[
s
]
+
w
]);
}
else
{
//gold->Set3D(1.0F, sent, w, buf[seqOffset[s] + w + 1]);
else
goldOffsets
[
wGold
++
]
=
gold
->
GetOffset3D
(
sent
,
w
,
buf
[
seqOffset
[
s
]
+
w
+
1
]);
}
}
wCount
++
;
wCountDec
++
;
...
...
source/tensor/core/movement/Gather.cpp
查看文件 @
dc56fd67
...
...
@@ -71,8 +71,6 @@ void _Gather(XTensor * s, XTensor * t, XTensor * srcIndex)
}
#endif
int
blockNum
=
1
;
int
blockSize
=
1
;
int
stride
=
1
;
int
indexSize
=
1
;
...
...
@@ -139,4 +137,4 @@ XTensor Gather(XTensor &s, XTensor &index)
}
}
}
//
namespace
nts
(
NiuTrans
.
Tensor
)
\ No newline at end of file
}
// namespace nts(NiuTrans.Tensor)
source/tensor/core/movement/Spread.cpp
查看文件 @
dc56fd67
...
...
@@ -224,8 +224,6 @@ void _SpreadForGather(XTensor * source, XTensor * collection, XTensor * index)
}
#endif
int
blockNum
=
1
;
int
blockSize
=
1
;
int
stride
=
1
;
int
indexSize
=
1
;
...
...
@@ -243,4 +241,4 @@ void _SpreadForGather(XTensor * source, XTensor * collection, XTensor * index)
}
}
}
//
namespace
nts
(
NiuTrans
.
Tensor
)
\ No newline at end of file
}
// namespace nts(NiuTrans.Tensor)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论