Skip to content

Commit 3c14d8f

Browse files
committed
Merge remote-tracking branch 'ups/develop' into fea/ut/vis
2 parents dd0b203 + a56b663 commit 3c14d8f

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

paddle/fluid/operators/softmax_with_cross_entropy_op.cu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ __global__ void CrossEntropyGrad(T* logit_grad, const int64_t* labels,
3131
for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < batch_size;
3232
i += blockDim.x * gridDim.x) {
3333
int idx = i * class_num + labels[i];
34-
logit_grad[idx] -= static_cast<T>(1.);
34+
logit_grad[idx] -=
35+
ignore_index == labels[i] ? static_cast<T>(0.) : static_cast<T>(1.);
3536
}
3637
}
3738

python/paddle/fluid/tests/unittests/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ list(REMOVE_ITEM TEST_OPS test_cond_op) # FIXME(qijun): https://github.com/Paddl
2828

2929
list(REMOVE_ITEM TEST_OPS op_test) # op_test is a helper python file, not a test
3030
list(REMOVE_ITEM TEST_OPS decorators) # decorators is a helper python file, not a test
31+
if(APPLE)
32+
# this op is not support on mac
33+
list(REMOVE_ITEM TEST_OPS test_fusion_seqexpand_concat_fc_op)
34+
endif()
3135

3236
function(py_test_modules TARGET_NAME)
3337
if(WITH_TESTING)

python/paddle/fluid/tests/unittests/test_data_balance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def setUp(self):
8484
self.data_file_name = './data_balance_test.recordio'
8585
self.lod_data_file_name = './data_balance_with_lod_test.recordio'
8686
self.total_ins_num = 50
87-
self.batch_size = 10
87+
self.batch_size = 12
8888
self.prepare_data()
8989
self.prepare_lod_data()
9090

python/paddle/fluid/tests/unittests/test_reader_reset.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from __future__ import print_function
16-
16+
import os
1717
import paddle.fluid as fluid
1818
import paddle
1919
import numpy as np
@@ -41,6 +41,8 @@ def fake_data_generator():
4141
self.data_file_name, reader, feeder)
4242

4343
def setUp(self):
44+
# set parallel threads to fit 20 batches in line 49
45+
os.environ['CPU_NUM'] = str(20)
4446
self.use_cuda = fluid.core.is_compiled_with_cuda()
4547
self.data_file_name = './reader_reset_test.recordio'
4648
self.ins_shape = [3]

0 commit comments

Comments
 (0)