Esempio n. 1
0
        public MPSCnnFullyConnected(IMTLDevice device, MPSCnnConvolutionDescriptor convolutionDescriptor, float[] kernelWeights, float[] biasTerms, MPSCnnConvolutionFlags flags)
            : base(NSObjectFlag.Empty)
        {
            if (kernelWeights == null)
            {
                throw new ArgumentNullException(nameof(kernelWeights));
            }

            unsafe {
                fixed(float *kernelWeightsptr = kernelWeights)
                fixed(float *biasTermsptr = biasTerms)
                InitializeHandle(InitWithDevice(device, convolutionDescriptor, (IntPtr)kernelWeightsptr, (IntPtr)biasTermsptr, flags), "initWithDevice:convolutionDescriptor:kernelWeights:biasTerms:flags:");
            }
        }
Esempio n. 2
0
 public MPSCnnFullyConnected(IMTLDevice device, MPSCnnConvolutionDescriptor convolutionDescriptor, float[] kernelWeights, float[] biasTerms, MPSCnnConvolutionFlags flags)
     : this(device, convolutionDescriptor, MPSKernel.GetPtr(kernelWeights, true), MPSKernel.GetPtr(biasTerms, false), flags)
 {
 }