286 references to InternalDataKind
Microsoft.ML.Core (110)
CommandLine\CmdParser.cs (1)
2019else if (value is Data.InternalDataKind kind)
Data\ColumnTypeExtensions.cs (24)
65/// Gets the equivalent <see cref="InternalDataKind"/> for the <paramref name="columnType"/>'s RawType. 66/// This can return default(<see cref="InternalDataKind"/>) if the RawType doesn't have a corresponding 67/// <see cref="InternalDataKind"/>. 69public static InternalDataKind GetRawKind(this DataViewType columnType) 71columnType.RawType.TryGetDataKind(out InternalDataKind result); 112public static PrimitiveDataViewType PrimitiveTypeFromKind(InternalDataKind kind) 114if (kind == InternalDataKind.TX) 116if (kind == InternalDataKind.BL) 118if (kind == InternalDataKind.TS) 120if (kind == InternalDataKind.DT) 122if (kind == InternalDataKind.DZ) 124if (kind == InternalDataKind.UG) 131InternalDataKind kind; 139private static NumberDataViewType NumberTypeFromKind(InternalDataKind kind) 143case InternalDataKind.I1: 145case InternalDataKind.U1: 147case InternalDataKind.I2: 149case InternalDataKind.U2: 151case InternalDataKind.I4: 153case InternalDataKind.U4: 155case InternalDataKind.I8: 157case InternalDataKind.U8: 159case InternalDataKind.R4: 161case InternalDataKind.R8:
Data\DataKind.cs (85)
75/// Data type specifier used in command line. <see cref="InternalDataKind"/> is the underlying version of <see cref="DataKind"/> 124public const InternalDataKind KindMin = InternalDataKind.I1; 125public const InternalDataKind KindLim = InternalDataKind.U16 + 1; 131public static int ToIndex(this InternalDataKind kind) 139public static InternalDataKind FromIndex(int index) 142return (InternalDataKind)(index + (int)KindMin); 146/// This function converts <paramref name="dataKind"/> to <see cref="InternalDataKind"/>. 147/// Because <see cref="DataKind"/> is a subset of <see cref="InternalDataKind"/>, the conversion is straightforward. 149public static InternalDataKind ToInternalDataKind(this DataKind dataKind) => (InternalDataKind)dataKind; 153/// Because <see cref="DataKind"/> is a subset of <see cref="InternalDataKind"/>, we should check if <paramref name="kind"/> 156public static DataKind ToDataKind(this InternalDataKind kind) 158Contracts.Check(kind != InternalDataKind.UG); 166public static ulong ToMaxInt(this InternalDataKind kind) 170case InternalDataKind.I1: 172case InternalDataKind.U1: 174case InternalDataKind.I2: 176case InternalDataKind.U2: 178case InternalDataKind.I4: 180case InternalDataKind.U4: 182case InternalDataKind.I8: 184case InternalDataKind.U8: 221public static long ToMinInt(this InternalDataKind kind) 225case InternalDataKind.I1: 227case InternalDataKind.U1: 229case InternalDataKind.I2: 231case InternalDataKind.U2: 233case InternalDataKind.I4: 235case InternalDataKind.U4: 237case InternalDataKind.I8: 239case InternalDataKind.U8: 249public static Type ToType(this InternalDataKind kind) 253case InternalDataKind.I1: 255case InternalDataKind.U1: 257case InternalDataKind.I2: 259case InternalDataKind.U2: 261case InternalDataKind.I4: 263case InternalDataKind.U4: 265case InternalDataKind.I8: 267case InternalDataKind.U8: 269case InternalDataKind.R4: 271case InternalDataKind.R8: 273case InternalDataKind.TX: 275case InternalDataKind.BL: 277case InternalDataKind.TS: 279case InternalDataKind.DT: 281case InternalDataKind.DZ: 283case InternalDataKind.UG: 293public static bool TryGetDataKind(this Type type, out InternalDataKind kind) 299kind = InternalDataKind.I1; 301kind = InternalDataKind.U1; 303kind = InternalDataKind.I2; 305kind = InternalDataKind.U2; 307kind = InternalDataKind.I4; 309kind = InternalDataKind.U4; 311kind = InternalDataKind.I8; 313kind = InternalDataKind.U8; 315kind = InternalDataKind.R4; 317kind = InternalDataKind.R8; 319kind = InternalDataKind.TX; 321kind = InternalDataKind.BL; 323kind = InternalDataKind.TS; 325kind = InternalDataKind.DT; 327kind = InternalDataKind.DZ; 329kind = InternalDataKind.UG; 332kind = default(InternalDataKind); 343public static string GetString(this InternalDataKind kind) 347case InternalDataKind.I1: 349case InternalDataKind.I2: 351case InternalDataKind.I4: 353case InternalDataKind.I8: 355case InternalDataKind.U1: 357case InternalDataKind.U2: 359case InternalDataKind.U4: 361case InternalDataKind.U8: 363case InternalDataKind.R4: 365case InternalDataKind.R8: 367case InternalDataKind.BL: 369case InternalDataKind.TX: 371case InternalDataKind.TS: 373case InternalDataKind.DT: 375case InternalDataKind.DZ: 377case InternalDataKind.UG:
Microsoft.ML.Core.Tests (35)
UnitTests\ColumnTypes.cs (1)
79Assert.True(rawType.TryGetDataKind(out var kind));
UnitTests\CoreBaseTestClass.cs (34)
89var result = vecType.ItemType.RawType.TryGetDataKind(out var kind); 94case InternalDataKind.I1: 96case InternalDataKind.U1: 98case InternalDataKind.I2: 100case InternalDataKind.U2: 102case InternalDataKind.I4: 104case InternalDataKind.U4: 106case InternalDataKind.I8: 108case InternalDataKind.U8: 110case InternalDataKind.R4: 112case InternalDataKind.R8: 117case InternalDataKind.Text: 119case InternalDataKind.Bool: 121case InternalDataKind.TimeSpan: 123case InternalDataKind.DT: 125case InternalDataKind.DZ: 127case InternalDataKind.UG: 133var result = type.RawType.TryGetDataKind(out var kind); 137case InternalDataKind.I1: 139case InternalDataKind.U1: 141case InternalDataKind.I2: 143case InternalDataKind.U2: 145case InternalDataKind.I4: 147case InternalDataKind.U4: 149case InternalDataKind.I8: 151case InternalDataKind.U8: 153case InternalDataKind.R4: 155case InternalDataKind.R8: 160case InternalDataKind.Text: 162case InternalDataKind.Bool: 164case InternalDataKind.TimeSpan: 166case InternalDataKind.DT: 168case InternalDataKind.DZ: 170case InternalDataKind.UG:
Microsoft.ML.Data (98)
Commands\TypeInfoCommand.cs (16)
54private sealed class SetOfKindsComparer : IEqualityComparer<ISet<InternalDataKind>> 56public bool Equals(ISet<InternalDataKind> x, ISet<InternalDataKind> y) 65public int GetHashCode(ISet<InternalDataKind> obj) 71foreach (var kind in obj.OrderBy(x => x)) 84var dstToSrcMap = new Dictionary<HashSet<InternalDataKind>, HashSet<InternalDataKind>>(comp); 85var srcToDstMap = new Dictionary<InternalDataKind, HashSet<InternalDataKind>>(); 87var kinds = Enum.GetValues(typeof(InternalDataKind)).Cast<InternalDataKind>().Distinct().OrderBy(k => k).ToArray(); 90HashSet<InternalDataKind> nonIdentity = null; 97var dstKinds = new HashSet<InternalDataKind>(); 111HashSet<InternalDataKind> srcKinds; 113dstToSrcMap[dstKinds] = srcKinds = new HashSet<InternalDataKind>(); 121HashSet<InternalDataKind> srcs;
DataLoadSave\Database\DatabaseLoader.cs (6)
145InternalDataKind dk; 569var kind = (InternalDataKind)ctx.Reader.ReadByte(); 570Contracts.CheckDecode(Enum.IsDefined(typeof(InternalDataKind), kind)); 641InternalDataKind rawKind = type.GetRawKind(); 642Contracts.Assert((InternalDataKind)(byte)rawKind == rawKind);
DataLoadSave\Database\DbExtensions.cs (15)
70/// <summary>Maps a <see cref="InternalDataKind"/> to the associated <see cref="DbType"/>.</summary> 71public static DbType ToDbType(this InternalDataKind dataKind) 75case InternalDataKind.I1: 80case InternalDataKind.U1: 85case InternalDataKind.I2: 90case InternalDataKind.U2: 95case InternalDataKind.I4: 100case InternalDataKind.U4: 105case InternalDataKind.I8: 110case InternalDataKind.U8: 115case InternalDataKind.R4: 120case InternalDataKind.R8: 125case InternalDataKind.TX: 130case InternalDataKind.BL: 135case InternalDataKind.DT:
DataLoadSave\Text\TextLoader.cs (18)
89/// <param name="kind"><see cref="InternalDataKind"/> of the items in the column.</param> 92private Column(string name, InternalDataKind kind, Range[] source, KeyCount keyCount = null) 110/// <see cref="InternalDataKind"/> of the items in the column. It defaults to float. 111/// Although <see cref="InternalDataKind"/> is internal, <see cref="Type"/>'s information can be publicly accessed by <see cref="DataKind"/>. 115internal InternalDataKind Type = InternalDataKind.R4; 163InternalDataKind kind; 166Type = kind == default ? InternalDataKind.R4 : kind; 609public readonly InternalDataKind Kind; 769InternalDataKind kind; 776kind = col.Type == default ? InternalDataKind.R4 : col.Type; 777ch.CheckUserArg(Enum.IsDefined(typeof(InternalDataKind), kind), nameof(Column.Type), "Bad item type"); 934var kind = (InternalDataKind)ctx.Reader.ReadByte(); 935Contracts.CheckDecode(Enum.IsDefined(typeof(InternalDataKind), kind)); 1021InternalDataKind rawKind = type.GetRawKind(); 1022Contracts.Assert((InternalDataKind)(byte)rawKind == rawKind); 1608InternalDataKind dk;
DataLoadSave\Text\TextLoaderParser.cs (5)
71for (var kind = InternalDataKindExtensions.KindMin; kind < InternalDataKindExtensions.KindLim; kind++) 117public Func<RowSet, ColumnPipe> GetCreatorOne(InternalDataKind kind) 124public Func<RowSet, ColumnPipe> GetCreatorVec(InternalDataKind kind) 693var mapOne = new Dictionary<InternalDataKind, Func<RowSet, ColumnPipe>>(); 694var mapVec = new Dictionary<InternalDataKind, Func<RowSet, ColumnPipe>>();
DataLoadSave\Text\TextSaver.cs (1)
507InternalDataKind kind = itemType.GetRawKind();
DataView\ArrayDataViewBuilder.cs (1)
88values.GetType().GetElementType().TryGetDataKind(out InternalDataKind kind);
Transforms\Normalizer.cs (11)
439InternalDataKind itemKindOld = (InternalDataKind)ctx.Reader.ReadByte(); 440Contracts.CheckDecode(itemKindOld == InternalDataKind.R4 || itemKindOld == InternalDataKind.R8); 453InternalDataKind itemKind = (InternalDataKind)ctx.Reader.ReadByte(); 454Contracts.CheckDecode(itemKind == InternalDataKind.R4 || itemKind == InternalDataKind.R8); 476itemType.RawType.TryGetDataKind(out InternalDataKind itemKind); 477Contracts.Assert(itemKind == InternalDataKind.R4 || itemKind == InternalDataKind.R8);
Transforms\TypeConverting.cs (15)
62public InternalDataKind? ResultType; 89if (!TypeParsingUtils.TryParseDataKind(extra, out InternalDataKind kind, out KeyCount)) 91ResultType = kind == default ? default(InternalDataKind?) : kind; 136public InternalDataKind? ResultType; 222Host.Assert((InternalDataKind)(byte)_columns[i].OutputKind.ToInternalDataKind() == _columns[i].OutputKind.ToInternalDataKind()); 265var kind = (InternalDataKind)(b & 0x7F); 266Host.CheckDecode(Enum.IsDefined(typeof(InternalDataKind), kind)); 323InternalDataKind kind; 327kind = InternalDataKind.Num; 331kind = srcType is KeyDataViewType ? srcType.GetRawKind() : InternalDataKind.U8; 353internal static bool GetNewType(IExceptionContext ectx, DataViewType srcType, InternalDataKind kind, KeyCount keyCount, out PrimitiveDataViewType itemType) 412private static bool CanConvertToType(IExceptionContext ectx, DataViewType srcType, InternalDataKind kind, KeyCount keyCount, 416ectx.Assert(Enum.IsDefined(typeof(InternalDataKind), kind)); 589if (!type.TryGetDataKind(out InternalDataKind OutputKind))
Transforms\ValueMapping.cs (5)
201if (!type.TryGetDataKind(out InternalDataKind kind)) 777if (!type.TryGetDataKind(out InternalDataKind kind)) 1111var kind = _valueMap.ValueColumn.Type.GetRawKind(); 1230else if (typeValue == NumberDataViewType.UInt64 || kind == InternalDataKind.U8) 1236else if (typeValue == NumberDataViewType.UInt32 || kind == InternalDataKind.U4)
Transforms\ValueToKeyMappingTransformer.cs (1)
892InternalDataKind dataKind;
Utilities\TypeParsingUtils.cs (4)
21/// the returned <see cref="InternalDataKind"/> can really be made into a key with the specified <paramref name="keyCount"/>. 27public static bool TryParseDataKind(string str, out InternalDataKind dataKind, out KeyCount keyCount) 55public static KeyDataViewType ConstructKeyType(InternalDataKind? type, KeyCount keyCount) 60Type rawType = type.HasValue ? type.Value.ToType() : InternalDataKind.U8.ToType();
Microsoft.ML.Ensemble (3)
OutputCombiners\BaseStacking.cs (3)
157case InternalDataKind.BL: 159case InternalDataKind.R4: 161case InternalDataKind.U4:
Microsoft.ML.OnnxTransformer (14)
OnnxUtils.cs (14)
510private static readonly Dictionary<Type, InternalDataKind> _typeToKindMap = 511new Dictionary<Type, InternalDataKind> 513{ typeof(Single) , InternalDataKind.R4}, 514{ typeof(Double) , InternalDataKind.R8}, 515{ typeof(Int16) , InternalDataKind.I2}, 516{ typeof(Int32) , InternalDataKind.I4}, 517{ typeof(Int64) , InternalDataKind.I8}, 518{ typeof(UInt16) , InternalDataKind.U2}, 519{ typeof(UInt32) , InternalDataKind.U4}, 520{ typeof(UInt64) , InternalDataKind.U8}, 521{ typeof(String) , InternalDataKind.TX}, 522{ typeof(Boolean) , InternalDataKind.BL}, 523{ typeof(SByte) , InternalDataKind.I1}, 524{ typeof(Byte) , InternalDataKind.U1},
Microsoft.ML.Parquet (7)
PartitionedFileLoader.cs (4)
90public InternalDataKind? Type; 121InternalDataKind? kind = null; 122if (kindStr != null && TypeParsingUtils.TryParseDataKind(kindStr, out InternalDataKind parsedKind, out var keyCount)) 200Type = InternalDataKind.Text
PartitionedPathParser.cs (3)
85public InternalDataKind Type = InternalDataKind.Text; 297Type = InternalDataKind.Text
Microsoft.ML.Recommender (1)
RecommenderUtils.cs (1)
41/// is a <see cref="InternalDataKind.U4"/> key of known cardinality.
Microsoft.ML.Tests (14)
ExpressionLanguageTests\ExpressionLanguageTests.cs (13)
232InternalDataKind kind; 289case InternalDataKind.BL: 298case InternalDataKind.I4: 307case InternalDataKind.I8: 316case InternalDataKind.R4: 325case InternalDataKind.R8: 334case InternalDataKind.TX: 351case InternalDataKind.BL: 358case InternalDataKind.I4: 365case InternalDataKind.I8: 372case InternalDataKind.R4: 379case InternalDataKind.R8: 386case InternalDataKind.TX:
FakeSchemaTest.cs (1)
43Assert.Equal(InternalDataKind.U4, columnB.Type.GetRawKind());
Microsoft.ML.Transforms (4)
ExpressionTransformer.cs (3)
256public readonly InternalDataKind[] InputKinds; 274InputKinds = new InternalDataKind[inputTypes.Length]; 375var kind = InternalDataKindExtensions.FromIndex(dataKindIndex);
MissingValueHandlingTransformer.cs (1)
182if (!replaceItemType.RawType.TryGetDataKind(out InternalDataKind replaceItemTypeKind))