Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
3c14d8f7
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3c14d8f7
编写于
9月 13, 2018
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'ups/develop' into fea/ut/vis
上级
dd0b2036
a56b6637
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
10 addition
and
3 deletion
+10
-3
paddle/fluid/operators/softmax_with_cross_entropy_op.cu
paddle/fluid/operators/softmax_with_cross_entropy_op.cu
+2
-1
python/paddle/fluid/tests/unittests/CMakeLists.txt
python/paddle/fluid/tests/unittests/CMakeLists.txt
+4
-0
python/paddle/fluid/tests/unittests/test_data_balance.py
python/paddle/fluid/tests/unittests/test_data_balance.py
+1
-1
python/paddle/fluid/tests/unittests/test_reader_reset.py
python/paddle/fluid/tests/unittests/test_reader_reset.py
+3
-1
未找到文件。
paddle/fluid/operators/softmax_with_cross_entropy_op.cu
浏览文件 @
3c14d8f7
...
@@ -31,7 +31,8 @@ __global__ void CrossEntropyGrad(T* logit_grad, const int64_t* labels,
...
@@ -31,7 +31,8 @@ __global__ void CrossEntropyGrad(T* logit_grad, const int64_t* labels,
for
(
int
i
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
i
<
batch_size
;
for
(
int
i
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
i
<
batch_size
;
i
+=
blockDim
.
x
*
gridDim
.
x
)
{
i
+=
blockDim
.
x
*
gridDim
.
x
)
{
int
idx
=
i
*
class_num
+
labels
[
i
];
int
idx
=
i
*
class_num
+
labels
[
i
];
logit_grad
[
idx
]
-=
static_cast
<
T
>
(
1.
);
logit_grad
[
idx
]
-=
ignore_index
==
labels
[
i
]
?
static_cast
<
T
>
(
0.
)
:
static_cast
<
T
>
(
1.
);
}
}
}
}
...
...
python/paddle/fluid/tests/unittests/CMakeLists.txt
浏览文件 @
3c14d8f7
...
@@ -28,6 +28,10 @@ list(REMOVE_ITEM TEST_OPS test_cond_op) # FIXME(qijun): https://github.com/Paddl
...
@@ -28,6 +28,10 @@ list(REMOVE_ITEM TEST_OPS test_cond_op) # FIXME(qijun): https://github.com/Paddl
list
(
REMOVE_ITEM TEST_OPS op_test
)
# op_test is a helper python file, not a test
list
(
REMOVE_ITEM TEST_OPS op_test
)
# op_test is a helper python file, not a test
list
(
REMOVE_ITEM TEST_OPS decorators
)
# decorators is a helper python file, not a test
list
(
REMOVE_ITEM TEST_OPS decorators
)
# decorators is a helper python file, not a test
if
(
APPLE
)
# this op is not support on mac
list
(
REMOVE_ITEM TEST_OPS test_fusion_seqexpand_concat_fc_op
)
endif
()
function
(
py_test_modules TARGET_NAME
)
function
(
py_test_modules TARGET_NAME
)
if
(
WITH_TESTING
)
if
(
WITH_TESTING
)
...
...
python/paddle/fluid/tests/unittests/test_data_balance.py
浏览文件 @
3c14d8f7
...
@@ -84,7 +84,7 @@ class TestDataBalance(unittest.TestCase):
...
@@ -84,7 +84,7 @@ class TestDataBalance(unittest.TestCase):
self
.
data_file_name
=
'./data_balance_test.recordio'
self
.
data_file_name
=
'./data_balance_test.recordio'
self
.
lod_data_file_name
=
'./data_balance_with_lod_test.recordio'
self
.
lod_data_file_name
=
'./data_balance_with_lod_test.recordio'
self
.
total_ins_num
=
50
self
.
total_ins_num
=
50
self
.
batch_size
=
1
0
self
.
batch_size
=
1
2
self
.
prepare_data
()
self
.
prepare_data
()
self
.
prepare_lod_data
()
self
.
prepare_lod_data
()
...
...
python/paddle/fluid/tests/unittests/test_reader_reset.py
浏览文件 @
3c14d8f7
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
# limitations under the License.
# limitations under the License.
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle
import
paddle
import
numpy
as
np
import
numpy
as
np
...
@@ -41,6 +41,8 @@ class TestReaderReset(unittest.TestCase):
...
@@ -41,6 +41,8 @@ class TestReaderReset(unittest.TestCase):
self
.
data_file_name
,
reader
,
feeder
)
self
.
data_file_name
,
reader
,
feeder
)
def
setUp
(
self
):
def
setUp
(
self
):
# set parallel threads to fit 20 batches in line 49
os
.
environ
[
'CPU_NUM'
]
=
str
(
20
)
self
.
use_cuda
=
fluid
.
core
.
is_compiled_with_cuda
()
self
.
use_cuda
=
fluid
.
core
.
is_compiled_with_cuda
()
self
.
data_file_name
=
'./reader_reset_test.recordio'
self
.
data_file_name
=
'./reader_reset_test.recordio'
self
.
ins_shape
=
[
3
]
self
.
ins_shape
=
[
3
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录