フィルターのクリア

Vector norms not interacting with dlarrays as documented

2 ビュー (過去 30 日間)
Alex B
Alex B 2024 年 4 月 25 日
コメント済み: Alex B 2024 年 4 月 25 日
I'm attempting to update a peice of code to support autograd and the final step of the script is to take the 1-norm of some data, then use autograd to find its first two derivatives. According to this page vecnorm() (and normalize() with the 'norm' method) should support doing this, however it will throw an error instead saying "Error using vecnorm Invalid data type. First argument must be single or double."
This can be reproduced easily by:
q = dlarray([2,2,2])
vecnorm(q,1,2) % can be any norm, not just 1-norm
q = double(q) % to make absolutely sure its a double dlarray
vecnorm(q,1,2)
Normalize, another function listed as having dlarray support, seems to have a similar behavior and outputs the same error message when run as
normalize(q,2,"norm")
I've verified that both functions work as documented when called on variables which are not dlarrays.
Am I doing something wrong or is there something else I'm missing? I'm running on r2023a.

採用された回答

Steven Lord
Steven Lord 2024 年 4 月 25 日
According to the Release Notes, support for dlarrays in vecnorm was added in release R2023b.
  1 件のコメント
Alex B
Alex B 2024 年 4 月 25 日
That's my bad. I'll update to the next version, thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by