Ejemplo n.º 1
0
        private KerasCntkDll()
        {
            _dll = new WindowsDll("KerasCntk.dll");

            _fitModel      = (KerasFitModelDelegate)_dll.GetDelegate <KerasFitModelDelegate>("KerasFitModel");
            _deletePointer = (KerasDeletePointerDelegate)_dll.GetDelegate <KerasDeletePointerDelegate>("KerasDeletePointer");
        }
Ejemplo n.º 2
0
        public void ChooseDll(GroupBox groupBox)
        {
            // wybor ddl na podsawie tekstu z radioButtona zaznaczonego w wyslanym goupboxie
            RadioButton checkedRadioButton = groupBox.Controls.Cast <RadioButton>()
                                             .Where(x => x.Checked)
                                             .FirstOrDefault();

            Dll = dllTypes.Where(x => checkedRadioButton.Text.ToUpper().Contains(x.Key))
                  .First()
                  .Value;
        }
Ejemplo n.º 3
0
        private CodecDll()
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                _dll = new WindowsDll("encoding.dll");
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                _dll = new LinuxDll("encoding.so");
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                throw new NotSupportedException($"MaxOS is not supported yet");
            }

            _generateKey     = (GenerateKeyDelegate)_dll.GetDelegate <GenerateKeyDelegate>("GenerateKey");
            _encodeFile      = (EncodeFileDelegate)_dll.GetDelegate <EncodeFileDelegate>("EncodeFile");
            _decodeFile      = (DecodeFileDelegate)_dll.GetDelegate <DecodeFileDelegate>("DecodeFile");
            _computeHash     = (ComputeHashDelegate)_dll.GetDelegate <ComputeHashDelegate>("ComputeHash");
            _computeDataHash = (ComputeDataHashDelegate)_dll.GetDelegate <ComputeDataHashDelegate>("ComputeDataHash");
        }