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