Skip to content

Commit

Permalink
fix waveleop op numpy use
Browse files Browse the repository at this point in the history
  • Loading branch information
ckolbPTB committed Nov 18, 2024
1 parent bab2440 commit 7c5273c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/mrpro/operators/WaveletOp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from collections.abc import Sequence
from typing import Literal

import numpy as np
import torch
from ptwt.conv_transform import wavedec, waverec
from ptwt.conv_transform_2 import wavedec2, waverec2
Expand Down Expand Up @@ -366,7 +365,7 @@ def _stacked_tensor_to_coeff(self, coefficients_stack: torch.Tensor) -> list[tor
3D: [aaa, aad_n, ada_n, add_n, ..., ..., aad_1, ada_1, add_1, ...]
"""
coefficients = torch.split(
coefficients_stack, [int(np.prod(shape)) for shape in self.coefficients_shape], dim=-1
coefficients_stack, [int(torch.prod(torch.as_tensor(shape))) for shape in self.coefficients_shape], dim=-1
)
return [
torch.reshape(coeff, (*coeff.shape[:-1], *shape))
Expand Down

0 comments on commit 7c5273c

Please sign in to comment.