Skip to content

Conversation

@tan90xx
Copy link
Contributor

@tan90xx tan90xx commented Oct 29, 2024

def get_alpha(sr, mode="hts", n_freq=10, n_alpha=100):

A[0, :] = alpha**arange

When mode="auto", get_alpha returned a numpy.ndarray, which does not support operations with Tensor. In contrast, when mode="hts", get_alpha returned a float. Since PyTorch has built-in compatibility for float types, this will not raise an error.

This PR ensures that "auto" mode consistently return a float, which avoids type errors.

TypeError: unsupported operand type(s) for ** or pow(): 'numpy.ndarray' and 'Tensor'
@codecov
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.98%. Comparing base (053d888) to head (ebc861b).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #105   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         220      220           
  Lines        6600     6603    +3     
=======================================
+ Hits         6599     6602    +3     
  Misses          1        1           
Flag Coverage Δ
unittests 99.98% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@takenori-y takenori-y added the bug Something isn't working label Oct 30, 2024
@takenori-y takenori-y merged commit cde6f1c into sp-nitech:master Oct 30, 2024
3 checks passed
@takenori-y
Copy link
Contributor

Thanks for the modification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants