示例#1
0
    unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc)
    {
        var @ref = (__Native *)pDesc;

        InputTensor.__MarshalFree(ref @ref->InputTensor);

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

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

        OutputTensor.__MarshalFree(ref @ref->OutputTensor);

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

        UnsafeUtilities.Free(@ref);
    }
示例#2
0
    unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc)
    {
        var @ref = (__Native *)pDesc;

        InputTensor.__MarshalFree(ref @ref->InputTensor);
        FilterTensor.__MarshalFree(ref @ref->FilterTensor);

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

        OutputTensor.__MarshalFree(ref @ref->OutputTensor);
        UnsafeUtilities.Free(@ref->Strides);
        UnsafeUtilities.Free(@ref->Dilations);
        UnsafeUtilities.Free(@ref->StartPadding);
        UnsafeUtilities.Free(@ref->EndPadding);
        UnsafeUtilities.Free(@ref->OutputPadding);

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

        UnsafeUtilities.Free(@ref);
    }
示例#3
0
    unsafe IntPtr IOperatorDescriptionMarshal.__MarshalAlloc()
    {
        __Native * @ref = UnsafeUtilities.Alloc <__Native>();

        @ref->InputTensor  = InputTensor.__MarshalAlloc();
        @ref->OutputTensor = OutputTensor.__MarshalAlloc();

        var dimensionCount = InputWindowOffsets.Length;

        if (InputWindowSizes.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("InputWindowSizes must have the same length as InputWindowOffsets.");
        }
        if (InputWindowStrides.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("InputWindowStrides must have the same length as InputWindowOffsets.");
        }
        @ref->DimensionCount = dimensionCount;

        @ref->InputWindowOffsets = new(UnsafeUtilities.AllocWithData(InputWindowOffsets));
        @ref->InputWindowSizes   = new(UnsafeUtilities.AllocWithData(InputWindowSizes));
        @ref->InputWindowStrides = new(UnsafeUtilities.AllocWithData(InputWindowStrides));

        return(new(@ref));
    }
    unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc)
    {
        var @ref = (__Native *)pDesc;

        InputTensor.__MarshalFree(ref @ref->InputTensor);

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

        FilterTensor.__MarshalFree(ref @ref->FilterTensor);

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

        OutputTensor.__MarshalFree(ref @ref->OutputTensor);
        UnsafeUtilities.Free(@ref->Strides);
        UnsafeUtilities.Free(@ref->Dilations);
        UnsafeUtilities.Free(@ref->StartPadding);
        UnsafeUtilities.Free(@ref->EndPadding);

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

        @ref->InputTensor           = InputTensor.__MarshalAlloc();
        @ref->InputZeroPointTensor  = (InputZeroPointTensor != null) ? InputZeroPointTensor.Value.__MarshalAlloc() : IntPtr.Zero;
        @ref->FilterTensor          = FilterTensor.__MarshalAlloc();
        @ref->FilterZeroPointTensor = (FilterZeroPointTensor != null) ? FilterZeroPointTensor.Value.__MarshalAlloc() : IntPtr.Zero;
        @ref->OutputTensor          = OutputTensor.__MarshalAlloc();

        var dimensionCount = Strides.Length;

        if (Dilations.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("Dilations must have the same length as Strides.");
        }
        if (StartPadding.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("StartPadding must have the same length as Strides.");
        }
        if (EndPadding.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("EndPadding must have the same length as Strides.");
        }
        @ref->DimensionCount = dimensionCount;

        @ref->Strides      = new(UnsafeUtilities.AllocWithData(Strides));
        @ref->Dilations    = new(UnsafeUtilities.AllocWithData(Dilations));
        @ref->StartPadding = new(UnsafeUtilities.AllocWithData(StartPadding));
        @ref->EndPadding   = new(UnsafeUtilities.AllocWithData(EndPadding));
        @ref->GroupCount   = GroupCount;

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

        @ref->InputTensor  = InputTensor.__MarshalAlloc();
        @ref->OutputTensor = OutputTensor.__MarshalAlloc();

        var dimensionCount = Strides.Length;

        if (WindowSize.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("WindowSize must have the same length as Strides.");
        }
        if (StartPadding.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("StartPadding must have the same length as Strides.");
        }
        if (EndPadding.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("EndPadding must have the same length as Strides.");
        }
        @ref->DimensionCount = dimensionCount;

        @ref->Strides        = new(UnsafeUtilities.AllocWithData(Strides));
        @ref->WindowSize     = new(UnsafeUtilities.AllocWithData(WindowSize));
        @ref->StartPadding   = new(UnsafeUtilities.AllocWithData(StartPadding));
        @ref->EndPadding     = new(UnsafeUtilities.AllocWithData(EndPadding));
        @ref->IncludePadding = IncludePadding;

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

        @ref->InputTensor       = InputTensor.__MarshalAlloc();
        @ref->OutputTensor      = OutputTensor.__MarshalAlloc();
        @ref->InterpolationMode = InterpolationMode;

        var dimensionCount = Scales.Length;

        if (InputPixelOffsets.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("InputPixelOffsets must have the same length as Scales.");
        }
        if (OutputPixelOffsets.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("OutputPixelOffsets must have the same length as Scales.");
        }
        @ref->DimensionCount = dimensionCount;

        @ref->Scales             = new(UnsafeUtilities.AllocWithData(Scales));
        @ref->InputPixelOffsets  = new(UnsafeUtilities.AllocWithData(InputPixelOffsets));
        @ref->OutputPixelOffsets = new(UnsafeUtilities.AllocWithData(OutputPixelOffsets));

        return(new(@ref));
    }
    unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc)
    {
        var @ref = (__Native *)pDesc;

        OutputTensor.__MarshalFree(ref @ref->OutputTensor);

        UnsafeUtilities.Free(@ref);
    }
示例#9
0
    unsafe IntPtr IOperatorDescriptionMarshal.__MarshalAlloc()
    {
        __Native * @ref = UnsafeUtilities.Alloc <__Native>();

        @ref->InputTensor  = InputTensor.__MarshalAlloc();
        @ref->OutputTensor = OutputTensor.__MarshalAlloc();
        @ref->ScaleBias    = (ScaleBias != null) ? new(UnsafeUtilities.AllocWithData(ScaleBias.Value)) : IntPtr.Zero;

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

        @ref->OutputTensor = OutputTensor.__MarshalAlloc();
        @ref->Offset       = Offset;
        @ref->Value        = Value;

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

        @ref->InputTensor  = InputTensor.__MarshalAlloc();
        @ref->OutputTensor = OutputTensor.__MarshalAlloc();
        @ref->BlockSize    = BlockSize;

        return(new(@ref));
    }
示例#12
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));
    }
    unsafe IntPtr IOperatorDescriptionMarshal.__MarshalAlloc()
    {
        __Native * @ref = UnsafeUtilities.Alloc <__Native>();

        @ref->OutputTensor  = OutputTensor.__MarshalAlloc();
        @ref->ValueDataType = ValueDataType;
        @ref->ValueStart    = ValueStart;
        @ref->ValueDelta    = ValueDelta;

        return(new(@ref));
    }
示例#14
0
    unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc)
    {
        var @ref = (__Native *)pDesc;

        InputTensor.__MarshalFree(ref @ref->InputTensor);
        RoiTensor.__MarshalFree(ref @ref->RoiTensor);
        BatchIndicesTensor.__MarshalFree(ref @ref->BatchIndicesTensor);
        OutputTensor.__MarshalFree(ref @ref->OutputTensor);

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

        @ref->InputTensor  = InputTensor.__MarshalAlloc();
        @ref->OutputTensor = OutputTensor.__MarshalAlloc();
        @ref->RepeatsCount = Repeats.Length;
        @ref->Repeats      = new(UnsafeUtilities.AllocWithData(Repeats));

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

        @ref->IndicesTensor = IndicesTensor.__MarshalAlloc();
        @ref->ValuesTensor  = ValuesTensor.__MarshalAlloc();
        @ref->OutputTensor  = OutputTensor.__MarshalAlloc();
        @ref->Axis          = Axis;

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

        @ref->ATensor         = ATensor.__MarshalAlloc();
        @ref->BTensor         = BTensor.__MarshalAlloc();
        @ref->OutputTensor    = OutputTensor.__MarshalAlloc();
        @ref->FusedActivation = (FusedActivation != null) ? FusedActivation.Value.__MarshalAlloc() : IntPtr.Zero;

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

        @ref->InputTensor     = InputTensor.__MarshalAlloc();
        @ref->OutputTensor    = OutputTensor.__MarshalAlloc();
        @ref->Axis            = Axis;
        @ref->AxisDirection   = AxisDirection;
        @ref->HasExclusiveSum = HasExclusiveSum;

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

        @ref->InputTensor  = InputTensor.__MarshalAlloc();
        @ref->OutputTensor = OutputTensor.__MarshalAlloc();
        @ref->Scale        = Scale;
        @ref->ChannelCount = Bias.Length;
        @ref->Bias         = new(UnsafeUtilities.AllocWithData(Bias));

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

        @ref->InputTensor           = InputTensor.__MarshalAlloc();
        @ref->IndicesTensor         = IndicesTensor.__MarshalAlloc();
        @ref->OutputTensor          = OutputTensor.__MarshalAlloc();
        @ref->InputDimensionCount   = InputDimensionCount;
        @ref->IndicesDimensionCount = IndicesDimensionCount;

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

        @ref->InputTensor  = InputTensor.__MarshalAlloc();
        @ref->OutputTensor = OutputTensor.__MarshalAlloc();
        @ref->Axis         = Axis;
        @ref->Epsilon      = Epsilon;
        @ref->P            = P;

        return(new(@ref));
    }
示例#22
0
    unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc)
    {
        var @ref = (__Native *)pDesc;

        InputTensor.__MarshalFree(ref @ref->InputTensor);
        OutputTensor.__MarshalFree(ref @ref->OutputTensor);
        UnsafeUtilities.Free(@ref->InputWindowOffsets);
        UnsafeUtilities.Free(@ref->InputWindowSizes);
        UnsafeUtilities.Free(@ref->InputWindowStrides);

        UnsafeUtilities.Free(@ref);
    }
示例#23
0
    unsafe IntPtr IOperatorDescriptionMarshal.__MarshalAlloc()
    {
        __Native * @ref = UnsafeUtilities.Alloc <__Native>();

        @ref->InputTensor  = InputTensor.__MarshalAlloc();
        @ref->RoiTensor    = RoiTensor.__MarshalAlloc();
        @ref->OutputTensor = OutputTensor.__MarshalAlloc();
        @ref->SpatialScale = SpatialScale;
        @ref->PooledSize   = PooledSize;

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

        @ref->InputTensor       = InputTensor.__MarshalAlloc();
        @ref->OutputTensor      = OutputTensor.__MarshalAlloc();
        @ref->InterpolationMode = InterpolationMode;
        @ref->ScaleCount        = Scales.Length;
        @ref->Scales            = new(UnsafeUtilities.AllocWithData(Scales));

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

        @ref->InputTensor   = InputTensor.__MarshalAlloc();
        @ref->OutputTensor  = OutputTensor.__MarshalAlloc();
        @ref->AxisCount     = Axes.Length;
        @ref->Axes          = new(UnsafeUtilities.AllocWithData(Axes));
        @ref->AxisDirection = AxisDirection;

        return(new(@ref));
    }
    unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc)
    {
        var @ref = (__Native *)pDesc;

        InputTensor.__MarshalFree(ref @ref->InputTensor);
        OutputTensor.__MarshalFree(ref @ref->OutputTensor);

        if (@ref->ScaleBias != IntPtr.Zero)
        {
            UnsafeUtilities.Free(@ref->ScaleBias);
        }

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

        @ref->InputTensor  = InputTensor.__MarshalAlloc();
        @ref->OutputTensor = OutputTensor.__MarshalAlloc();
        @ref->CrossChannel = CrossChannel;
        @ref->LocalSize    = LocalSize;
        @ref->Alpha        = Alpha;
        @ref->Beta         = Beta;
        @ref->Bias         = Bias;

        return(new(@ref));
    }
示例#28
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);
    }
    unsafe void IOperatorDescriptionMarshal.__MarshalFree(ref IntPtr pDesc)
    {
        var @ref = (__Native *)pDesc;

        ATensor.__MarshalFree(ref @ref->ATensor);
        BTensor.__MarshalFree(ref @ref->BTensor);
        OutputTensor.__MarshalFree(ref @ref->OutputTensor);

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

        UnsafeUtilities.Free(@ref);
    }
示例#30
0
    unsafe IntPtr IOperatorDescriptionMarshal.__MarshalAlloc()
    {
        __Native * @ref = UnsafeUtilities.Alloc <__Native>();

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

        return(new(@ref));
    }