Edit: oh this is free :)
dz1 := dz2.ExecOp('MatMul', Parameters.w2.ExecOp('Transpose', TTensor.CreateInt32([1,0]).Temp).Temp).Temp *
h1 * (TTensor.CreateSingle(1).Temp - h1).Temp;
but the first partdz2.ExecOp('MatMul', Parameters.w2.ExecOp('Transpose', TTensor.CreateInt32([1,0]).Temp).Temp).Temp * h1
is already a TTensor, what is not freed. If the IterationCount is larger than in your example, it is a severe memory leak.dz1 := (dz2.ExecOp('MatMul', Parameters.w2.ExecOp('Transpose', TTensor.CreateInt32([1,0]).Temp).Temp).Temp *
h1).Temp * (TTensor.CreateSingle(1).Temp - h1).Temp;
part1 := LabelsT.ExecOp('Neg').Temp * predictions.ExecOp('Log');
I t should bepart1 := LabelsT.ExecOp('Neg').Temp * predictions.ExecOp('Log').Temp;
and then no memory leak at all.Please check it at GitHub.com/tensorflowforpascal.That link is not good. Is https://github.com/zsoltszakaly/tensorflowforpascal the good one?
As far as I can see it already works in {$mode delphi} apart from the dreaded inline variable declarations.
If you agree with me such code is a bad idea, I can provide patches/pull requests against your repository.
Note that bringing the vars to the declaration section will still keep it Delphi compatible.
I use it for the Enumerable<TSource> type because it includes practically all the methods of the IEnumerable class of c# and python. then it is used for Tuple and Nullable types.So perhaps we should just create a replacement for this class in Lazarus and ditch Springs4Delphi.
I tried but can't compile it under Lazarus because of Springs4Delphi. Anybody knows how to use Springs4Delphi in Lazarus?
There are two separate wrappers mentioned in this thread. Does the other one compile?This one? https://github.com/zsoltszakaly/tensorflowforpascal