Skip to content

Add ZeroPadding module #1324

Closed
Closed

Description

@andrewgiessel

Hello- currently pytorch has ReflectionPadding and ReplicationPadding but not ZeroPadding, and I'd like to help add it.

(Bear with me, as I'm new to the codebase)

After reading a bit, it seems like the currently implemented padding modules call backend functions which are themselves automatically imported/created by scanning through the the function definitions in THNN.h, and wrapping compiled code based on that.

However, the legacy padding module seems a bit simpler, and is in pure python. I hoping there is some standard and straight-foreward way to re-write updateOutput() and updateGradInput() into forward() and backward(), respectively. In support of this notion, I wasn't able to find any THNN code for padding.

Any guidance?

Activity

  1. apaszke commented on Apr 21, 2017

    @apaszke
    Contributor

    I think F.pad already supports that, so ZeroPadding could just call into that.

  2. added
    todo
    on Apr 21, 2017
  3. andrewgiessel commented on Apr 21, 2017

    @andrewgiessel
    ContributorAuthor

    Ah, excellent. Should be straight forward, thanks!

  4. varunagrawal commented on Sep 11, 2017

    @varunagrawal
    Contributor

    @andrewgiessel @apaszke I guess we can close this?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    todo

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions