44 references to ModelHeader
Microsoft.ML.Core (44)
Data\ModelHeader.cs (31)
107public static void BeginWrite(BinaryWriter writer, out long fpMin, out ModelHeader header) 109Contracts.Assert(Marshal.SizeOf(typeof(ModelHeader)) == Size); 113header = default(ModelHeader); 117header.FpModel = ModelHeader.Size; 120byte[] headerBytes = new byte[ModelHeader.Size]; 122Contracts.CheckIO(writer.FpCur() == fpMin + ModelHeader.Size); 129public static void EndWrite(BinaryWriter writer, long fpMin, ref ModelHeader header, NormStr.Pool pool = null, string loaderAssemblyName = null) 175private static void WriteLoaderAssemblyName(BinaryWriter writer, long fpMin, ref ModelHeader header, string loaderAssemblyName) 197public static void WriteHeaderAndTailCore(BinaryWriter writer, long fpMin, ref ModelHeader header) 215byte[] headerBytes = new byte[ModelHeader.Size]; 218Contracts.Assert(writer.FpCur() == fpMin + ModelHeader.Size); 226public static void EndModelCore(BinaryWriter writer, long fpMin, ref ModelHeader header) 228Contracts.Check(header.FpModel == ModelHeader.Size); 241public static void SetVersionInfo(ref ModelHeader header, VersionInfo ver) 253public static void SetLoaderSig(ref ModelHeader header, string sig) 279public static void SetLoaderSigAlt(ref ModelHeader header, string sig) 305public static void MarshalToBytes(ref ModelHeader header, byte[] bytes) 310fixed (ModelHeader* pheader = &header) 321public static void BeginRead(out long fpMin, out ModelHeader header, out string[] strings, out string loaderAssemblyName, BinaryReader reader) 325byte[] headerBytes = reader.ReadBytes(ModelHeader.Size); 326Contracts.CheckDecode(headerBytes.Length == ModelHeader.Size); 327ModelHeader.MarshalFromBytes(out header, headerBytes); 330if (!ModelHeader.TryValidate(ref header, reader, fpMin, out strings, out loaderAssemblyName, out ex)) 340public static void EndRead(long fpMin, ref ModelHeader header, BinaryReader reader) 349public static void CheckVersionInfo(ref ModelHeader header, VersionInfo ver) 372public static void MarshalFromBytes(out ModelHeader header, byte[] bytes) 377fixed (ModelHeader* pheader = &header) 386public static bool TryValidate(ref ModelHeader header, long size, out Exception ex) 466public static bool TryValidate(ref ModelHeader header, BinaryReader reader, long fpMin, out string[] strings, out string loaderAssemblyName, out Exception ex) 573public static string GetLoaderSig(ref ModelHeader header) 598public static string GetLoaderSigAlt(ref ModelHeader header)
Data\ModelLoadContext.cs (6)
56internal ModelHeader Header; 90ModelHeader.BeginRead(out FpMin, out Header, out Strings, out LoaderAssemblyName, Reader); 111ModelHeader.BeginRead(out FpMin, out Header, out Strings, out LoaderAssemblyName, Reader); 122ModelHeader.CheckVersionInfo(ref Header, ver); 130ModelHeader.CheckVersionInfo(ref Header, ver); 176ModelHeader.EndRead(FpMin, ref Header, Reader);
Data\ModelLoading.cs (2)
251string sig = ModelHeader.GetLoaderSig(ref Header); 265string sigAlt = ModelHeader.GetLoaderSigAlt(ref Header);
Data\ModelSaveContext.cs (5)
53internal ModelHeader Header; 103ModelHeader.BeginWrite(Writer, out FpMin, out Header); 133ModelHeader.BeginWrite(Writer, out FpMin, out Header); 150ModelHeader.SetVersionInfo(ref Header, ver); 241ModelHeader.EndWrite(Writer, FpMin, ref Header, Strings, _loaderAssemblyName);