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

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

        return(new(@ref));
    }
    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));
    }
示例#4
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;
        @ref->Minimum      = Minimum;
        @ref->Maximum      = Maximum;

        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));
    }
示例#6
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->Axis                = Axis;
        @ref->AxisDirection       = AxisDirection;
        @ref->HasExclusiveProduct = HasExclusiveProduct;

        return(new(@ref));
    }
示例#8
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));
    }
示例#9
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;
        @ref->BatchDimensionCount   = BatchDimensionCount;

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

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

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

        @ref->InputTensor             = InputTensor.__MarshalAlloc();
        @ref->RoiTensor               = RoiTensor.__MarshalAlloc();
        @ref->BatchIndicesTensor      = BatchIndicesTensor.__MarshalAlloc();
        @ref->OutputTensor            = OutputTensor.__MarshalAlloc();
        @ref->ReductionFunction       = ReductionFunction;
        @ref->InterpolationMode       = InterpolationMode;
        @ref->SpatialScaleX           = SpatialScaleX;
        @ref->SpatialScaleY           = SpatialScaleY;
        @ref->OutOfBoundsInputValue   = OutOfBoundsInputValue;
        @ref->MinimumSamplesPerOutput = MinimumSamplesPerOutput;
        @ref->MaximumSamplesPerOutput = MaximumSamplesPerOutput;

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

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

        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.");
        }
        if (OutputPadding.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("OutputPadding 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->OutputPadding   = new(UnsafeUtilities.AllocWithData(OutputPadding));
        @ref->GroupCount      = GroupCount;
        @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->PaddingMode  = PaddingMode;
        @ref->PaddingValue = PaddingValue;

        var dimensionCount = StartPadding.Length;

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

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

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

        @ref->InputCount = InputTensors.Length;

        @ref->InputTensors = IntPtr.Zero;
        if (InputTensors.Length != 0)
        {
            var inputTensorsPtr = UnsafeUtilities.Alloc <TensorDescription.__Native>(InputTensors.Length);
            for (int i = 0; i < InputTensors.Length; i++)
            {
                InputTensors[i].__MarshalTo(ref inputTensorsPtr[i]);
            }
            @ref->InputTensors = new(inputTensorsPtr);
        }

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

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

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

        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.");
        }
        if (Dilations.Length != dimensionCount)
        {
            throw new IndexOutOfRangeException("Dilations 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->Dilations    = new(UnsafeUtilities.AllocWithData(Dilations));

        return(new(@ref));
    }