Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SeetaResearch
/
Dragon
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f52f82f6
authored
7 years ago
by
Ting PAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the potential crash on L2NormOp
1 parent
904b59fd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
Dragon/python/setup.py
Dragon/src/contrib/rcnn/proposal_op.cc
Dragon/src/contrib/rcnn/proposal_op.h
Dragon/src/operators/norm/l2_norm_op.cc
Dragon/python/setup.py
View file @
f52f82f
...
...
@@ -36,7 +36,7 @@ find_packages('dragon')
find_modules
()
setup
(
name
=
'dragon'
,
version
=
'0.2.1.
4
'
,
version
=
'0.2.1.
5
'
,
description
=
'Dragon: A Computation Graph Virtual Machine Based Deep Learning Framework'
,
url
=
'https://github.com/neopenx/Dragon'
,
author
=
'Ting Pan'
,
...
...
This diff is collapsed.
Click to expand it.
Dragon/src/contrib/rcnn/proposal_op.cc
View file @
f52f82f
...
...
@@ -104,7 +104,7 @@ void ProposalOp<Context>::RunWithType() {
// distribute rois into K bins
if
(
OutputSize
()
>
1
)
{
CHECK_EQ
(
max_level
-
min_level
+
1
,
(
int
)
OutputSize
())
<<
"Excepted "
<<
OutputSize
()
<<
" outputs for levels between "
<<
"
\n
Excepted "
<<
OutputSize
()
<<
" outputs for levels between "
<<
"["
<<
min_level
<<
", "
<<
max_level
<<
"]."
;
vector
<
vector
<
TIndex
>
>
roi_bins
(
OutputSize
(),
vector
<
TIndex
>
());
vector
<
T
*>
outputs
;
...
...
@@ -130,7 +130,7 @@ template <class Context>
void
ProposalOp
<
Context
>::
RunOnDevice
()
{
num_images
=
input
(
0
).
dim
(
0
);
CHECK_EQ
(
input
(
-
1
).
count
(),
num_images
*
3
)
<<
"Excepted "
<<
num_images
*
3
<<
" groups image info, "
<<
"
\n
Excepted "
<<
num_images
*
3
<<
" groups image info, "
<<
"but got "
<<
input
(
-
1
).
count
()
/
3
<<
"."
;
roi_indices_
.
Reshape
(
vector
<
TIndex
>
(
1
,
post_nms_top_n
));
output
(
0
)
->
Reshape
(
vector
<
TIndex
>
({
num_images
*
post_nms_top_n
,
5
}));
...
...
This diff is collapsed.
Click to expand it.
Dragon/src/contrib/rcnn/proposal_op.h
View file @
f52f82f
...
...
@@ -42,4 +42,4 @@ class ProposalOp final : public Operator<Context> {
}
// namespace dragon
#endif // DRAGON_OPERATORS_CONTRIB_RCNN_PROPOSAL_OP_H_
\ No newline at end of file
#endif // DRAGON_CONTRIB_RCNN_PROPOSAL_OP_H_
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Dragon/src/operators/norm/l2_norm_op.cc
View file @
f52f82f
...
...
@@ -25,6 +25,7 @@ void L2NormOp<Context>::RunWithType() {
auto
*
Ydata
=
output
(
0
)
->
template
mutable_data
<
T
,
Context
>
();
auto
*
Bdata
=
buffer
->
template
mutable_data
<
T
,
Context
>
();
auto
*
Ndata
=
norm
->
template
mutable_data
<
T
,
Context
>
();
math
::
Set
<
T
,
Context
>
(
norm
->
count
(),
dragon_cast
<
T
,
float
>
(
eps
),
Ndata
);
for
(
int
n
=
0
;
n
<
outer_dim
;
n
++
)
{
if
(
across_inner
)
{
...
...
@@ -34,7 +35,6 @@ void L2NormOp<Context>::RunWithType() {
Ndata_
[
n
]
=
pow
(
sum_of_sqr
+
eps
,
0.5
);
math
::
Scale
<
T
,
Context
>
(
buffer
->
count
(),
1.0
/
Ndata_
[
n
],
Xdata
,
Ydata
);
}
else
{
math
::
Set
<
T
,
Context
>
(
norm
->
count
(),
dragon_cast
<
T
,
float
>
(
eps
),
Ndata
);
math
::
Square
<
T
,
Context
>
(
buffer
->
count
(),
Xdata
,
Bdata
);
// compute T1 = \sum_{i} x_{i,j}^{2}
math
::
Gemv
<
T
,
Context
>
(
CblasTrans
,
dim
,
inner_dim
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment