Basic Examples (3)
Basic Examples
(3)
Build and reduce a tiny term:
In[1]:=
Needs["WolframInstitute`THVMLink`"];TInit[];TWnf[TApp[TLam[x,x],TLam[y,y]]]
Out[1]=
TTerm
_________________________________________________________________________________________________________________
Build a UOp graph and realize it on the active backend:
In[1]:=
x=TTensorCreate[{1.,2.,3.,4.}];y=TTensorCreate[{10.,20.,30.,40.}];TTensorData@TRealize[TUOpAdd[x,y]]
Out[1]=
NumericArray
_________________________________________________________________________________________________________________
Take a gradient through a small expression (every float leaf is auto-graded, no marking):
In[1]:=
w=TTensorCreate[{1.,2.,3.}];x=TTensorCreate[{4.,5.,6.}];TRealize@TGrad[TUOpReduce[TUOpMul[w,x],0,"SUM"]];TTensorData@TRealize@TGradOf[w]
Out[1]=
NumericArray
Scope (2)
Scope
(2)
Applications (2)
Applications
(2)
Properties and Relations (1)
Properties and Relations
(1)
Possible Issues
Possible Issues
The default target does not rebuild the WL paclet dynamic library; the host tests and notebooks dispatch through the stale . Always run from the repository root after touching C sources.
make
.wlt
LibraryResources/THVMLink.dylib
make&&makewl