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

Implemented NumPy backend for Component class #38325

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

amanmoon
Copy link
Contributor

@amanmoon amanmoon commented Jul 2, 2024

This PR introduces a new backend for the Component class using NumPy.
The ComponentNumpy class is created keeping the expansion of sage.tensor to multi-dimensional array in mind.
The changes align with the Python array API standards.

Summary of changes:

The ComponentNumpy class has a new added parameter self._shape.
The previous self._frame and self._sindex parameters have been converted to a tuple to house multiple frames and start index in order of dimension.
The self._comp parameter is initialized to numpy.ndarray with all values as zero.

Fixes #30308
#38248

@mkoeppe

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

@amanmoon amanmoon marked this pull request as draft July 2, 2024 08:00
@amanmoon amanmoon force-pushed the feature/numpy_backend branch 4 times, most recently from c2d1744 to 2c5bcee Compare July 2, 2024 10:26
@@ -0,0 +1,993 @@
# Tensor Component Backend using numpy.ndarray
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add standard file header (comment and copyright comment)

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.

sage.tensor.modules: Add backend using NumPy ndarray
2 participants