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
750e38f5
Unverified
Commit
750e38f5
authored
Jul 12, 2020
by
peterjc123
Committed by
GitHub
Jul 12, 2020
Browse files
Fixes function signatures for torch::nn::Functional (#2463)
parent
cf534fda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
torchvision/csrc/models/modelsimpl.h
torchvision/csrc/models/modelsimpl.h
+5
-5
No files found.
torchvision/csrc/models/modelsimpl.h
View file @
750e38f5
...
@@ -14,22 +14,22 @@ namespace modelsimpl {
...
@@ -14,22 +14,22 @@ namespace modelsimpl {
// TODO here torch::relu_ and torch::adaptive_avg_pool2d wrapped in
// TODO here torch::relu_ and torch::adaptive_avg_pool2d wrapped in
// torch::nn::Fuctional don't work. so keeping these for now
// torch::nn::Fuctional don't work. so keeping these for now
inline
torch
::
Tensor
&
relu_
(
torch
::
Tensor
x
)
{
inline
torch
::
Tensor
&
relu_
(
const
torch
::
Tensor
&
x
)
{
return
torch
::
relu_
(
x
);
return
x
.
relu_
();
}
}
inline
torch
::
Tensor
relu6_
(
torch
::
Tensor
x
)
{
inline
torch
::
Tensor
&
relu6_
(
const
torch
::
Tensor
&
x
)
{
return
x
.
clamp_
(
0
,
6
);
return
x
.
clamp_
(
0
,
6
);
}
}
inline
torch
::
Tensor
adaptive_avg_pool2d
(
inline
torch
::
Tensor
adaptive_avg_pool2d
(
torch
::
Tensor
x
,
const
torch
::
Tensor
&
x
,
torch
::
ExpandingArray
<
2
>
output_size
)
{
torch
::
ExpandingArray
<
2
>
output_size
)
{
return
torch
::
adaptive_avg_pool2d
(
x
,
output_size
);
return
torch
::
adaptive_avg_pool2d
(
x
,
output_size
);
}
}
inline
torch
::
Tensor
max_pool2d
(
inline
torch
::
Tensor
max_pool2d
(
torch
::
Tensor
x
,
const
torch
::
Tensor
&
x
,
torch
::
ExpandingArray
<
2
>
kernel_size
,
torch
::
ExpandingArray
<
2
>
kernel_size
,
torch
::
ExpandingArray
<
2
>
stride
)
{
torch
::
ExpandingArray
<
2
>
stride
)
{
return
torch
::
max_pool2d
(
x
,
kernel_size
,
stride
);
return
torch
::
max_pool2d
(
x
,
kernel_size
,
stride
);
...
...
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