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 20.00000% with 4 lines in your changes missing coverage. Please review.

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

Files with missing lines Patch % Lines
keras/src/backend/torch/nn.py 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20270      +/-   ##
==========================================
+ Coverage   66.34%   75.78%   +9.44%     
==========================================
  Files         508      527      +19     
  Lines       48264    60532   +12268     
  Branches     8882    12130    +3248     
==========================================
+ Hits        32020    45874   +13854     
+ Misses      14425    12609    -1816     
- Partials     1819     2049     +230     
Flag Coverage Δ
keras 75.68% <20.00%> (+9.34%) ⬆️
keras-jax 64.27% <20.00%> (?)
keras-numpy 59.80% <20.00%> (?)
keras-tensorflow 65.49% <20.00%> (-0.85%) ⬇️
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

@gbaned gbaned requested review from fchollet and removed request for fchollet November 28, 2024 09:25
@fchollet fchollet closed this Nov 28, 2024
@fchollet fchollet reopened this Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent execution results by the PyTorch backend
4 participants