Skip to content

feat: Add pt.multiply as an alias for pt.mul (NumPy compatibility)#2300

Open
Leoyang158 wants to merge 2 commits into
pymc-devs:mainfrom
Leoyang158:fix/issue-1096-add-multiply-alias
Open

feat: Add pt.multiply as an alias for pt.mul (NumPy compatibility)#2300
Leoyang158 wants to merge 2 commits into
pymc-devs:mainfrom
Leoyang158:fix/issue-1096-add-multiply-alias

Conversation

@Leoyang158

Copy link
Copy Markdown

Closes #1096

Description

This PR resolves #1096 by adding multiply as an alias for mul in pytensor/tensor/math.py and exporting it in __all__.
This brings the PyTensor API in closer alignment and compatibility with the NumPy API (which supports np.multiply).

Changes

  • Defined multiply = mul in pytensor/tensor/math.py.
  • Added "multiply" to the __all__ list in pytensor/tensor/math.py.
  • Added a unit test test_multiply() in tests/tensor/test_math.py verifying that multiply behaves correctly and identically to standard multiplication.

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.

Add alias for np.multiply

1 participant