Skip to content

Fix PyTorch apply_along_axis argument forwarding#3380

Closed
FlorianPfaff wants to merge 3 commits into
mainfrom
fix-pytorch-apply-along-axis-args
Closed

Fix PyTorch apply_along_axis argument forwarding#3380
FlorianPfaff wants to merge 3 commits into
mainfrom
fix-pytorch-apply-along-axis-args

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • patch the PyTorch backend apply_along_axis facade so extra positional and keyword arguments are forwarded to the 1-D callback
  • keep the existing PyTorch shape/permutation implementation unchanged
  • add regression coverage matching NumPy's apply_along_axis(func1d, axis, arr, *args, **kwargs) contract

Bug fixed

The PyTorch backend provided a NumPy-style apply_along_axis implementation, but its signature only accepted (func, axis, tensor). Valid NumPy-compatible calls such as backend.apply_along_axis(func, 1, values, scale, offset=...) failed with TypeError before the callback was invoked.

Notes

During connector editing, the package metadata/export tail in src/pyrecest/__init__.py was restored explicitly after the runtime patch. The exported API names remain present.

Testing

  • Added tests/backend_support/test_pytorch_apply_along_axis_contract.py::test_pytorch_apply_along_axis_forwards_callback_arguments
  • Full test execution was not available in this connector session; CI should run the focused PyTorch regression.

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 69.21s
✅ JSON prettier 7 0 0 0 1.05s
✅ JSON v8r 7 0 0 5.1s
✅ MARKDOWN markdownlint 68 0 0 0 1.8s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.89s
✅ PYTHON black 1094 0 0 0 60.5s
✅ PYTHON isort 1094 1 0 0 4.41s
✅ REPOSITORY checkov yes no no 49.46s
✅ REPOSITORY gitleaks yes no no 10.25s
✅ REPOSITORY git_diff yes no no 0.26s
✅ REPOSITORY secretlint yes no no 33.08s
✅ REPOSITORY syft yes no no 3.5s
✅ REPOSITORY trivy-sbom yes no no 11.9s
✅ REPOSITORY trufflehog yes no no 20.24s
✅ YAML prettier 11 0 0 0 0.73s
✅ YAML v8r 11 0 0 10.9s
✅ YAML yamllint 11 0 0 0.59s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.5.0 --custom-flavor-setup --custom-flavor-linters PYTHON_BLACK,PYTHON_ISORT,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant