Ejemplo n.º 1
0
    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));
    }
Ejemplo n.º 2
0
    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);
    }