Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
piiswrong committed Jun 19, 2017
1 parent 95ba377 commit fda3717
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/initialize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ void segfault_logger(int sig) {
}
#endif // DMLC_LOG_STACK_TRACE

if (prev_handler == nullptr ||
prev_handler == SIG_DFL) {
exit(1);
if (prev_handler == SIG_DFL) {
exit(-1);
} else if (prev_handler == SIG_IGN) {
} else {
prev_handler(sig);
Expand All @@ -44,6 +43,9 @@ class LibraryInitializer {
LibraryInitializer() {
dmlc::InitLogging("mxnet");
prev_handler = signal(SIGSEGV, segfault_logger);
if (prev_handler != SIG_DFL) {
signal(SIGSEGV, prev_handler);
}
#if MXNET_USE_PROFILER
// ensure profiler's constructor are called before atexit.
engine::Profiler::Get();
Expand Down
6 changes: 3 additions & 3 deletions tests/python/unittest/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3179,7 +3179,7 @@ def test_psroipooling():
op = mx.contrib.sym.PSROIPooling(data=im_data_var, rois=rois_data_var, spatial_scale=spatial_scale,
group_size=num_group, pooled_size=num_group,
output_dim=num_classes, name='test_op')
rtol, atol = 1e-2, 1e-4
rtol, atol = 1e-2, 1e-3
# By now we only have gpu implementation
if mx.Context.default_ctx.device_type == 'gpu':
check_numeric_gradient(op, [im_data, rois_data], rtol=rtol, atol=atol,
Expand Down Expand Up @@ -3215,7 +3215,7 @@ def test_deformable_convolution():
# wider tolerance needed for coordinate differential
rtol, atol = 1.0, 1e-2
else:
rtol, atol = 0.05, 1e-4
rtol, atol = 0.05, 1e-3
# By now we only have gpu implementation
if mx.Context.default_ctx.device_type == 'gpu':
check_numeric_gradient(op, [im_data, offset_data, weight, bias], rtol=rtol, atol=atol,
Expand Down Expand Up @@ -3248,7 +3248,7 @@ def test_deformable_psroipooling():
# wider tolerance needed for coordinate differential
rtol, atol = 1.0, 1e-2
else:
rtol, atol = 1e-2, 1e-4
rtol, atol = 1e-2, 1e-3
# By now we only have gpu implementation
if mx.Context.default_ctx.device_type == 'gpu':
check_numeric_gradient(op, [im_data, rois_data, offset_data], rtol=rtol, atol=atol,
Expand Down

0 comments on commit fda3717

Please sign in to comment.