Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
3c2c0022
Unverified
Commit
3c2c0022
authored
Apr 03, 2020
by
gslotman
Committed by
GitHub
Apr 03, 2020
Browse files
Fix some deprecated warnings (#2055)
parent
d0b32a11
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
torchvision/csrc/cpu/nms_cpu.cpp
torchvision/csrc/cpu/nms_cpu.cpp
+4
-4
No files found.
torchvision/csrc/cpu/nms_cpu.cpp
View file @
3c2c0022
...
@@ -5,10 +5,10 @@ at::Tensor nms_cpu_kernel(
...
@@ -5,10 +5,10 @@ at::Tensor nms_cpu_kernel(
const
at
::
Tensor
&
dets
,
const
at
::
Tensor
&
dets
,
const
at
::
Tensor
&
scores
,
const
at
::
Tensor
&
scores
,
const
float
iou_threshold
)
{
const
float
iou_threshold
)
{
AT_ASSERTM
(
!
dets
.
typ
e
().
is_cuda
(),
"dets must be a CPU tensor"
);
AT_ASSERTM
(
!
dets
.
options
().
devic
e
().
is_cuda
(),
"dets must be a CPU tensor"
);
AT_ASSERTM
(
!
scores
.
typ
e
().
is_cuda
(),
"scores must be a CPU tensor"
);
AT_ASSERTM
(
!
scores
.
options
().
devic
e
().
is_cuda
(),
"scores must be a CPU tensor"
);
AT_ASSERTM
(
AT_ASSERTM
(
dets
.
type
()
==
scores
.
type
(),
"dets should have the same type as scores"
);
dets
.
scalar_
type
()
==
scores
.
scalar_
type
(),
"dets should have the same type as scores"
);
if
(
dets
.
numel
()
==
0
)
if
(
dets
.
numel
()
==
0
)
return
at
::
empty
({
0
},
dets
.
options
().
dtype
(
at
::
kLong
));
return
at
::
empty
({
0
},
dets
.
options
().
dtype
(
at
::
kLong
));
...
@@ -74,7 +74,7 @@ at::Tensor nms_cpu(
...
@@ -74,7 +74,7 @@ at::Tensor nms_cpu(
const
float
iou_threshold
)
{
const
float
iou_threshold
)
{
auto
result
=
at
::
empty
({
0
},
dets
.
options
());
auto
result
=
at
::
empty
({
0
},
dets
.
options
());
AT_DISPATCH_FLOATING_TYPES
(
dets
.
type
(),
"nms"
,
[
&
]
{
AT_DISPATCH_FLOATING_TYPES
(
dets
.
scalar_
type
(),
"nms"
,
[
&
]
{
result
=
nms_cpu_kernel
<
scalar_t
>
(
dets
,
scores
,
iou_threshold
);
result
=
nms_cpu_kernel
<
scalar_t
>
(
dets
,
scores
,
iou_threshold
);
});
});
return
result
;
return
result
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment