Skip to content

Modifies TensorViewToNumpy and NumpyToTensorView for rank = 5#427

Merged
cliffburdick merged 1 commit intomainfrom
nvjonwong/rank5_to_from_numpy
Jun 2, 2023
Merged

Modifies TensorViewToNumpy and NumpyToTensorView for rank = 5#427
cliffburdick merged 1 commit intomainfrom
nvjonwong/rank5_to_from_numpy

Conversation

@nvjonwong
Copy link
Contributor

Modifies TensorViewToNumpy and NumpyToTensorView to accommodate rank=5 tensors.

@nvjonwong nvjonwong requested a review from cliffburdick June 2, 2023 21:34
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);?

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