Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "same" padding torch issue #20270

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sachinprasadhs
Copy link
Collaborator

This fixes the issue for all torch layers when used with padding="same" and data_format="channels_first".

This was not caught in any of the test case due to the reason that it only happens with the above condition and when the padding_size is obtained from _compute_padding_length is something like ((0,0), (1, 1))

Fixes: #20235

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 73.41%. Comparing base (7628a18) to head (b5e23e2).
Report is 21 commits behind head on master.

Files with missing lines Patch % Lines
keras/src/backend/torch/nn.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20270      +/-   ##
==========================================
+ Coverage   66.34%   73.41%   +7.06%     
==========================================
  Files         508      511       +3     
  Lines       48264    48737     +473     
  Branches     8882     8983     +101     
==========================================
+ Hits        32020    35778    +3758     
+ Misses      14425    11155    -3270     
+ Partials     1819     1804      -15     
Flag Coverage Δ
keras 73.34% <0.00%> (+6.99%) ⬆️
keras-jax 62.43% <0.00%> (?)
keras-numpy 57.58% <0.00%> (?)
keras-tensorflow 63.74% <0.00%> (-2.60%) ⬇️
keras.applications ?
keras.applications-jax ?
keras.applications-numpy ?
keras.applications-tensorflow ?
keras.applications-torch ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fchollet
Copy link
Member

Thanks, Sachin. It looks like relevant torch tests are failing, can you take a look? https://github.com/keras-team/keras/actions/runs/10931265787/job/30345878233?pr=20270

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.

Inconsistent execution results by the PyTorch backend
4 participants