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
ac620226
Commit
ac620226
authored
Nov 19, 2018
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some code
parent
80ab70a2
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
1 行增加
和
64 行删除
+1
-64
source/network/XBackwardShape.cpp
+1
-1
source/tensor/XMem.cpp
+0
-59
source/tensor/XTensor.cpp
+0
-3
source/tensor/function/CrossEntropy.cpp
+0
-1
没有找到文件。
source/network/XBackwardShape.cpp
查看文件 @
ac620226
...
@@ -372,7 +372,7 @@ dE/da = merge(dE/c_1, ...)
...
@@ -372,7 +372,7 @@ dE/da = merge(dE/c_1, ...)
void
XShapeGrad
::
GradSplitList
(
XTensor
*
node
,
bool
isEfficient
)
void
XShapeGrad
::
GradSplitList
(
XTensor
*
node
,
bool
isEfficient
)
{
{
XLink
&
income
=
node
->
income
;
XLink
&
income
=
node
->
income
;
XTensor
*
input
=
income
.
tails
[
0
];
//
XTensor * input = income.tails[0];
CheckNTErrors
(
income
.
tailNum
==
1
,
"Wrong input tensor number for SPLIT!"
);
CheckNTErrors
(
income
.
tailNum
==
1
,
"Wrong input tensor number for SPLIT!"
);
//CheckNTErrors(node->order == input->order + 1, "Wrong tensor orders!");
//CheckNTErrors(node->order == input->order + 1, "Wrong tensor orders!");
...
...
source/tensor/XMem.cpp
查看文件 @
ac620226
...
@@ -691,65 +691,6 @@ void * XMem::AllocStandard(int myDevID, MTYPE mySize, bool myIsRebuiltIndex)
...
@@ -691,65 +691,6 @@ void * XMem::AllocStandard(int myDevID, MTYPE mySize, bool myIsRebuiltIndex)
}
}
/* if there is still no available memory piece, we have to obtain a new block of memory. */
/* if there is still no available memory piece, we have to obtain a new block of memory. */
else
{
else
{
/*MTYPE used = 0;
MTYPE total = 0;
MTYPE free = 0;
for(int i = 0; i < blockNum; i++){
if(blocks[i].mem != NULL){
used += blocks[i].used;
total += blocks[i].size;
}
}
MPieceNode * bufNodes = new MPieceNode[MILLION];
int bufNodeCount = 0;
for(int i = 0; i <= indexEntryNum; i++){
entry = memIndex + i;
node = entry->next;
while(node != NULL){
bufNodes[bufNodeCount++] = *node;
if(node->size == 0){
MPieceNode * next = node->next;
node = next;
}
else{
if(node->head.state == 1 && node->size >= mySize){
fprintf(stderr, "hit!!!!!!!!!!!\n");
}
//fprintf(stderr, "%d %lld %lld %lld\n", node->head.blockID, free, node->size, mySize);
free += node->size;
node = node->next;
}
}
}
MTYPE headSize = 0;
MTYPE headSizeUsed = 0;
for(int i = 0, j = 0; i < blockNum; i++){
XMemBlock * block = blocks + i;
if(block->mem != NULL){
MHeader * head = block->head;
while(head != NULL){
if(head->state == 1){
headSize += head->size;
//fprintf(stderr, "%d head %lld\n", j++, head->size);
}
else{
headSizeUsed += head->size;
}
head = head->next;
}
}
}
delete[] bufNodes;
fprintf(stderr, "%lld %lld\n", headSize, headSizeUsed);
fprintf(stderr, "mem: %lld %lld %lld %lld\n", used, total, free, mySize);*/
int
bi
;
int
bi
;
for
(
bi
=
0
;
bi
<
blockNum
;
bi
++
){
for
(
bi
=
0
;
bi
<
blockNum
;
bi
++
){
XMemBlock
*
block
=
blocks
+
bi
;
XMemBlock
*
block
=
blocks
+
bi
;
...
...
source/tensor/XTensor.cpp
查看文件 @
ac620226
...
@@ -1115,9 +1115,6 @@ set the value of a cell in a 3d tensor in default type
...
@@ -1115,9 +1115,6 @@ set the value of a cell in a 3d tensor in default type
*/
*/
bool
XTensor
::
Set3D
(
DTYPE
value
,
int
d0
,
int
d1
,
int
d2
)
bool
XTensor
::
Set3D
(
DTYPE
value
,
int
d0
,
int
d1
,
int
d2
)
{
{
if
(
!
(
d2
>=
0
&&
d2
<
dimSize
[
2
]))
{
int
nnn
=
0
;
}
CheckNTErrors
(
order
==
3
,
"Cannot get a 2d cell for a tensor whose order is not 2!"
);
CheckNTErrors
(
order
==
3
,
"Cannot get a 2d cell for a tensor whose order is not 2!"
);
CheckNTErrors
(
d0
>=
0
&&
d0
<
dimSize
[
0
],
"dimension 0 is out of range!"
);
CheckNTErrors
(
d0
>=
0
&&
d0
<
dimSize
[
0
],
"dimension 0 is out of range!"
);
CheckNTErrors
(
d1
>=
0
&&
d1
<
dimSize
[
1
],
"dimension 1 is out of range!"
);
CheckNTErrors
(
d1
>=
0
&&
d1
<
dimSize
[
1
],
"dimension 1 is out of range!"
);
...
...
source/tensor/function/CrossEntropy.cpp
查看文件 @
ac620226
...
@@ -469,7 +469,6 @@ void _CrossEntropyBackward(XTensor * dedy, const XTensor * output,
...
@@ -469,7 +469,6 @@ void _CrossEntropyBackward(XTensor * dedy, const XTensor * output,
int
order
=
output
->
order
;
int
order
=
output
->
order
;
int
n
=
leadingDim
<
0
?
output
->
order
-
1
:
leadingDim
;
int
n
=
leadingDim
<
0
?
output
->
order
-
1
:
leadingDim
;
int
leadingDimSize
=
output
->
GetDim
(
n
);
int
leadingDimSize
=
output
->
GetDim
(
n
);
int
unitSize
=
dedy
->
unitSize
;
CheckNTErrors
(
n
>=
0
&&
n
<
output
->
order
,
CheckNTErrors
(
n
>=
0
&&
n
<
output
->
order
,
"Wrong leading dimension!"
);
"Wrong leading dimension!"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论