unsafe IntPtr IOperatorDescriptionMarshal.__MarshalAlloc()
    {
        __Native * @ref = UnsafeUtilities.Alloc <__Native>();

        @ref->InputTensor               = InputTensor.__MarshalAlloc();
        @ref->InputGradientTensor       = InputGradientTensor.__MarshalAlloc();
        @ref->MeanTensor                = MeanTensor.__MarshalAlloc();
        @ref->VarianceTensor            = VarianceTensor.__MarshalAlloc();
        @ref->ScaleTensor               = ScaleTensor.__MarshalAlloc();
        @ref->OutputGradientTensor      = OutputGradientTensor.__MarshalAlloc();
        @ref->OutputScaleGradientTensor = OutputScaleGradientTensor.__MarshalAlloc();
        @ref->OutputBiasGradientTensor  = OutputBiasGradientTensor.__MarshalAlloc();
        @ref->Epsilon = Epsilon;

        return(new(@ref));
    }
コード例 #2
0
    unsafe IntPtr IOperatorDescriptionMarshal.__MarshalAlloc()
    {
        __Native * @ref = UnsafeUtilities.Alloc <__Native>();

        @ref->InputTensor     = InputTensor.__MarshalAlloc();
        @ref->MeanTensor      = MeanTensor.__MarshalAlloc();
        @ref->VarianceTensor  = VarianceTensor.__MarshalAlloc();
        @ref->ScaleTensor     = ScaleTensor.__MarshalAlloc();
        @ref->BiasTensor      = BiasTensor.__MarshalAlloc();
        @ref->OutputTensor    = OutputTensor.__MarshalAlloc();
        @ref->Spatial         = Spatial;
        @ref->Epsilon         = Epsilon;
        @ref->FusedActivation = (FusedActivation != null) ? FusedActivation.Value.__MarshalAlloc() : IntPtr.Zero;

        return(new(@ref));
    }
コード例 #3
0
    unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc)
    {
        var @ref = (__Native *)pDesc;

        InputTensor.__MarshalFree(ref @ref->InputTensor);
        MeanTensor.__MarshalFree(ref @ref->MeanTensor);
        VarianceTensor.__MarshalFree(ref @ref->VarianceTensor);
        ScaleTensor.__MarshalFree(ref @ref->ScaleTensor);
        BiasTensor.__MarshalFree(ref @ref->BiasTensor);
        OutputTensor.__MarshalFree(ref @ref->OutputTensor);

        if (FusedActivation != null)
        {
            FusedActivation.Value.__MarshalFree(ref @ref->FusedActivation);
        }

        UnsafeUtilities.Free(@ref);
    }