unsafe IntPtr IOperatorDescriptionMarshal.__MarshalAlloc() { __Native * @ref = UnsafeUtilities.Alloc <__Native>(); @ref->InputStateTensor = InputStateTensor.__MarshalAlloc(); @ref->OutputTensor = OutputTensor.__MarshalAlloc(); @ref->OutputStateTensor = (OutputStateTensor != null) ? OutputStateTensor.Value.__MarshalAlloc() : IntPtr.Zero; @ref->Type = Type; return(new(@ref)); }
unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc) { var @ref = (__Native *)pDesc; InputStateTensor.__MarshalFree(ref @ref->InputStateTensor); OutputTensor.__MarshalFree(ref @ref->OutputTensor); if (OutputStateTensor != null) { OutputStateTensor.Value.__MarshalFree(ref @ref->OutputStateTensor); } UnsafeUtilities.Free(@ref); }