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

Modifies TensorViewToNumpy and NumpyToTensorView for rank = 5 #427

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

nvjonwong
Copy link
Collaborator

Modifies TensorViewToNumpy and NumpyToTensorView to accommodate rank=5 tensors.

@@ -330,7 +332,14 @@ class MatXPybind {
for (index_t s3 = 0; s3 < ten.Size(2); s3++) {
if constexpr (RANK > 3) {
for (index_t s4 = 0; s4 < ten.Size(3); s4++) {
ten(s1, s2, s3, s4) = ConvertComplex(ften.at(s1, s2, s3, s4));
if constexpr (RANK > 4) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you static_assert(RANK == 5);?

@@ -364,8 +374,15 @@ class MatXPybind {
for (index_t s3 = 0; s3 < ten.Size(2); s3++) {
if constexpr (RANK > 3) {
for (index_t s4 = 0; s4 < ten.Size(3); s4++) {
ften.mutable_at(s1, s2, s3, s4) =
ConvertComplex(ten(s1, s2, s3, s4));
if constexpr (RANK > 4) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

another static_assert

@cliffburdick cliffburdick merged commit 612579b into main Jun 2, 2023
@cliffburdick cliffburdick deleted the nvjonwong/rank5_to_from_numpy branch June 2, 2023 22:05
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.

2 participants