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
0fab5329
Unverified
Commit
0fab5329
authored
Aug 21, 2020
by
vfdev
Committed by
GitHub
Aug 21, 2020
Browse files
Fix doc's example (#2601)
offset's 1 dimension should be batch size
parent
39702993
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchvision/ops/deform_conv.py
torchvision/ops/deform_conv.py
+3
-3
No files found.
torchvision/ops/deform_conv.py
View file @
0fab5329
...
...
@@ -38,17 +38,17 @@ def deform_conv2d(
Examples::
>>> input = torch.rand(
1
, 3, 10, 10)
>>> input = torch.rand(
4
, 3, 10, 10)
>>> kh, kw = 3, 3
>>> weight = torch.rand(5, 3, kh, kw)
>>> # offset should have the same spatial size as the output
>>> # of the convolution. In this case, for an input of 10, stride of 1
>>> # and kernel size of 3, without padding, the output size is 8
>>> offset = torch.rand(
5
, 2 * kh * kw, 8, 8)
>>> offset = torch.rand(
4
, 2 * kh * kw, 8, 8)
>>> out = deform_conv2d(input, offset, weight)
>>> print(out.shape)
>>> # returns
>>> torch.Size([
1
, 5, 8, 8])
>>> torch.Size([
4
, 5, 8, 8])
"""
out_channels
=
weight
.
shape
[
0
]
...
...
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