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