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
190a5f8a
Unverified
Commit
190a5f8a
authored
Sep 07, 2020
by
mcarilli
Committed by
GitHub
Sep 07, 2020
Browse files
compiles (#2646)
parent
bb88c452
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
28 deletions
+5
-28
torchvision/csrc/ROIAlign.h
torchvision/csrc/ROIAlign.h
+2
-2
torchvision/csrc/autocast.h
torchvision/csrc/autocast.h
+1
-24
torchvision/csrc/nms.h
torchvision/csrc/nms.h
+2
-2
No files found.
torchvision/csrc/ROIAlign.h
View file @
190a5f8a
...
@@ -49,8 +49,8 @@ at::Tensor ROIAlign_autocast(
...
@@ -49,8 +49,8 @@ at::Tensor ROIAlign_autocast(
const
bool
aligned
)
{
const
bool
aligned
)
{
c10
::
impl
::
ExcludeDispatchKeyGuard
no_autocast
(
c10
::
DispatchKey
::
Autocast
);
c10
::
impl
::
ExcludeDispatchKeyGuard
no_autocast
(
c10
::
DispatchKey
::
Autocast
);
return
roi_align
(
return
roi_align
(
autocast
::
_cast
(
at
::
kFloat
,
input
),
at
::
autocast
::
cached
_cast
(
at
::
kFloat
,
input
),
autocast
::
_cast
(
at
::
kFloat
,
rois
),
at
::
autocast
::
cached
_cast
(
at
::
kFloat
,
rois
),
spatial_scale
,
spatial_scale
,
pooled_height
,
pooled_height
,
pooled_width
,
pooled_width
,
...
...
torchvision/csrc/autocast.h
View file @
190a5f8a
#pragma once
#pragma once
#if defined(WITH_CUDA) || defined(WITH_HIP)
#if defined(WITH_CUDA) || defined(WITH_HIP)
namespace
autocast
{
#include <ATen/autocast_mode.h>
inline
bool
is_eligible
(
const
at
::
Tensor
&
arg
)
{
return
(
arg
.
is_cuda
()
&&
arg
.
is_floating_point
()
&&
(
arg
.
scalar_type
()
!=
at
::
kDouble
));
}
// Overload to catch Tensor args
inline
at
::
Tensor
_cast
(
at
::
ScalarType
to_type
,
const
at
::
Tensor
&
arg
)
{
if
(
is_eligible
(
arg
)
&&
(
arg
.
scalar_type
()
!=
to_type
))
{
return
arg
.
to
(
to_type
);
}
else
{
return
arg
;
}
}
// Template to catch non-Tensor args
template
<
typename
T
>
inline
T
_cast
(
at
::
ScalarType
to_type
,
T
arg
)
{
return
arg
;
}
}
// namespace autocast
#endif
#endif
torchvision/csrc/nms.h
View file @
190a5f8a
...
@@ -28,8 +28,8 @@ at::Tensor nms_autocast(
...
@@ -28,8 +28,8 @@ at::Tensor nms_autocast(
const
double
iou_threshold
)
{
const
double
iou_threshold
)
{
c10
::
impl
::
ExcludeDispatchKeyGuard
no_autocast
(
c10
::
DispatchKey
::
Autocast
);
c10
::
impl
::
ExcludeDispatchKeyGuard
no_autocast
(
c10
::
DispatchKey
::
Autocast
);
return
nms
(
return
nms
(
autocast
::
_cast
(
at
::
kFloat
,
dets
),
at
::
autocast
::
cached
_cast
(
at
::
kFloat
,
dets
),
autocast
::
_cast
(
at
::
kFloat
,
scores
),
at
::
autocast
::
cached
_cast
(
at
::
kFloat
,
scores
),
iou_threshold
);
iou_threshold
);
}
}
#endif
#endif
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