Skip to content

Add zero padding module#1326

Merged
soumith merged 8 commits intopytorch:masterfrom
andrewgiessel:add-zero-padding-module
Apr 25, 2017
Merged

Add zero padding module#1326
soumith merged 8 commits intopytorch:masterfrom
andrewgiessel:add-zero-padding-module

Conversation

@andrewgiessel
Copy link
Copy Markdown
Contributor

Addresses #1324

Since F.pad simply wraps ConstantPad2d, I used ConstantPad2d instead.

@fmassa
Copy link
Copy Markdown
Member

fmassa commented Apr 22, 2017

Why restrict it to zero padding, and not just make a ConstantPad2d a module as well?

@andrewgiessel
Copy link
Copy Markdown
Contributor Author

andrewgiessel commented Apr 22, 2017 via email

Including test and __init__ import.  Not sure if the way I imported the
function (to avoid namespace clobber) is the best.
all of functional, but not sure if tha
@andrewgiessel
Copy link
Copy Markdown
Contributor Author

andrewgiessel commented Apr 24, 2017

Added ConstantPad2d(). There was a namespace conflict, and so I imported ConstantPad2d (the function) as F_ConstantPad2d. Another option would have been to import the whole namespace as F. Let me know what is preferred, and I'm happy to change.

Also the tests are failing for some import reason, even after @soumith's commit. I assume I need to add the import someplace else, but I'm not sure where.

Edit: oh, I think it's simply because these classes aren't in all.

@andrewgiessel
Copy link
Copy Markdown
Contributor Author

This is ready for review, I think. Thanks!

@apaszke @soumith @fmassa

@soumith soumith merged commit 41705ce into pytorch:master Apr 25, 2017
@soumith
Copy link
Copy Markdown
Collaborator

soumith commented Apr 25, 2017

thanks Andrew!

@fmassa
Copy link
Copy Markdown
Member

fmassa commented Apr 25, 2017

Hi, thanks for the PR!
One question: why add ZeroPad2d when we have ConstantPad2d?

@soumith
Copy link
Copy Markdown
Collaborator

soumith commented Apr 25, 2017

had a discussion with @apaszke

we think it's best to deprecate all padding layers to F.pad and nn.Pad and all crop layers to F.crop and nn.Crop

so please expect this pr to be deprecated soon.

@andrewgiessel
Copy link
Copy Markdown
Contributor Author

@soumith sure, that seems like a good idea. Can I do anything to help?

petrex pushed a commit to petrex/pytorch that referenced this pull request Sep 23, 2024
- Add missing common_utils.sh
- Update the install vision part
- Move to amdgpu rhel 9.3 builds
- Update to pick python from conda path
- Add a missing package
- Add ROCM_PATH and magma
- Updated repo radeon path
jagadish-amd pushed a commit to jagadish-amd/pytorch that referenced this pull request Jan 29, 2025
====================================================

[SOW MS3] Centos stream9 PyTorch image support (pytorch#1090)

* changes to build Centos stream 9 images

* Added scripts for centos and centos stream images

* Added an extra line

* Add ninja installation

* Optimized code

* Fixes

* Add comment

* Optimized code

* Added AMDGPU mapping for ROCm 5.2 and invalid-url for rocm_baseurl

Co-authored-by: Jithun Nair <37884920+jithunnair-amd@users.noreply.github.com>

Updated to latest conda for CentOS stream 9

[CS9] Updates to CentOS stream 9 build (pytorch#1326)

- Add missing common_utils.sh
- Update the install vision part
- Move to amdgpu rhel 9.3 builds
- Update to pick python from conda path
- Add a missing package
- Add ROCM_PATH and magma
- Updated repo radeon path
jagadish-amd pushed a commit to jagadish-amd/pytorch that referenced this pull request May 15, 2025
====================================================

[SOW MS3] Centos stream9 PyTorch image support (pytorch#1090)

* changes to build Centos stream 9 images

* Added scripts for centos and centos stream images

* Added an extra line

* Add ninja installation

* Optimized code

* Fixes

* Add comment

* Optimized code

* Added AMDGPU mapping for ROCm 5.2 and invalid-url for rocm_baseurl

Co-authored-by: Jithun Nair <37884920+jithunnair-amd@users.noreply.github.com>

Updated to latest conda for CentOS stream 9

[CS9] Updates to CentOS stream 9 build (pytorch#1326)

- Add missing common_utils.sh
- Update the install vision part
- Move to amdgpu rhel 9.3 builds
- Update to pick python from conda path
- Add a missing package
- Add ROCM_PATH and magma
- Updated repo radeon path

(cherry picked from commit 51ce1cc)

[rocm6.4_internal_testing] Update missing changes for CentOS9 (pytorch#1813)

To fix, https://ontrack-internal.amd.com/browse/SWDEV-505385 and
https://ontrack-internal.amd.com/browse/SWDEV-507301

(cherry picked from commit 956c145)

delete .ci/docker/common/install_db.sh
scotts added a commit to scotts/pytorch that referenced this pull request Mar 31, 2026
8b42d4c..185fe9c includes the following commits:

185fe9c Expose occupany limiting factors (pytorch#1330)
0c8ede0 remove the rocprofiler early exit hack (pytorch#1329)
4826a43 Remove duplicate test ignore (pytorch#1328)
37fada9 Ensure that async doesn't loop while sync is active (pytorch#1327)
628e1d0 Add host_name to OSS Kineto trace metadata via gethostname() (pytorch#1323)
9d7373b Revert D97166802 (pytorch#1326)
3a61657 Fix Lingering INT32 Overflow (pytorch#1324)
50a0085 Re-enabled some hardcoded tests (pytorch#1321)
e19dd92 Expose occupany limiting factors (pytorch#1322)

Authored with Claude.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants