Where is dlfeval tracing information stored?

3 ビュー (過去 30 日間)
Matt J
Matt J 2024 年 2 月 16 日
編集済み: Bruno Luong 2024 年 2 月 16 日
When dlfeval() is used to call a function, the computation is traced in such a way as to later allow automatic differentiation via dlgradient(). For example,
x=dlarray(rand(30));
f=@(x) sum(x*x'*x*x'*x*x'*x*x'*x*x'*x*x'*x*x');
y1=f(x);
y2=dlfeval(f,x);
My question is, where is this tracing information stored? In y2? If so, why does whos() not show any apparent additional memory consumption by y2, as compared to the untraced version y1?
whos y1 y2
Name Size Bytes Class Attributes y1 1x30 240 dlarray y2 1x30 240 dlarray

回答 (1 件)

Bruno Luong
Bruno Luong 2024 年 2 月 16 日
編集済み: Bruno Luong 2024 年 2 月 16 日
I don't kwow the dlarray class but IMO it looks like the creating function handle f is stored in some sort of private property in y2 well hidden and cannot be disclosed by whos command.

カテゴリ

Help Center および File ExchangeParticle Swarm についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by