private KerasCntkDll() { _dll = new WindowsDll("KerasCntk.dll"); _fitModel = (KerasFitModelDelegate)_dll.GetDelegate <KerasFitModelDelegate>("KerasFitModel"); _deletePointer = (KerasDeletePointerDelegate)_dll.GetDelegate <KerasDeletePointerDelegate>("KerasDeletePointer"); }
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"); }