3 writes to ItemType
Microsoft.ML.DataView (3)
VectorType.cs (3)
47ItemType = itemType; 65ItemType = itemType; 83ItemType = itemType;
305 references to ItemType
Microsoft.Data.Analysis (1)
IDataView.Extension.cs (1)
153var itemType = vectorType.ItemType;
Microsoft.ML.AutoML (1)
API\AutoCatalog.cs (1)
824&& !(data.Schema[c.ColumnIndex].Type is VectorDataViewType vt && vt.ItemType == BooleanDataViewType.Instance)).ToArray();
Microsoft.ML.Core (5)
Data\AnnotationUtils.cs (1)
295&& vectorType.ItemType is TextDataViewType;
Data\ColumnTypeExtensions.cs (3)
45public static DataViewType GetItemType(this DataViewType columnType) => (columnType as VectorDataViewType)?.ItemType ?? columnType; 90if (!vectorType.ItemType.Equals(otherVectorType.ItemType))
Data\IEstimator.cs (1)
161itemType = vectorType.ItemType;
Microsoft.ML.Core.Tests (3)
UnitTests\CoreBaseTestClass.cs (1)
89var result = vecType.ItemType.RawType.TryGetDataKind(out var kind);
UnitTests\ScoreSchemaTest.cs (1)
68Assert.Equal(TextDataViewType.Instance, (scoreMetadata.Schema[0].Type as VectorDataViewType).ItemType);
UnitTests\TestEntryPoints.cs (1)
5407Assert.True(type is VectorDataViewType vecType && vecType.ItemType is TextDataViewType && vecType.Size == 10);
Microsoft.ML.Data (192)
Commands\ShowSchemaCommand.cs (5)
255if (!type.ItemType.IsStandardScalar() && !(type.ItemType is KeyDataViewType)) 262var meth = del.GetMethodInfo().GetGenericMethodDefinition().MakeGenericMethod(type.ItemType.RawType); 273Contracts.Assert(type.ItemType.RawType == typeof(T)); 275var conv = Conversions.DefaultInstance.GetStringConversion<T>(type.ItemType);
Data\Conversion.cs (2)
684Contracts.CheckParam(type.ItemType.RawType == typeof(T), nameof(type)); 686var t = type.ItemType;
Data\DataViewUtils.cs (3)
868pipeType = typeof(ImplVec<>).MakeGenericType(vectorType.ItemType.RawType); 1341getter = Utils.MarshalInvoke(GetVectorFlatteningGetter<int>, vectorType.ItemType.RawType, 1342cursor, srcColIndex, vectorType.ItemType);
Data\ITransposeDataView.cs (1)
37/// <see cref="GetSlotType"/> with col=i may return a <see cref="VectorDataViewType"/> whose <see cref="VectorDataViewType.ItemType"/>
Data\RowCursorUtils.cs (6)
164var methodInfo = del.GetMethodInfo().GetGenericMethodDefinition().MakeGenericMethod(typeSrc.ItemType.RawType, typeDst.RawType); 184var methodInfo = del.GetMethodInfo().GetGenericMethodDefinition().MakeGenericMethod(typeSrc.ItemType.RawType, typeof(TDst)); 201var methodInfo = del.GetMethodInfo().GetGenericMethodDefinition().MakeGenericMethod(typeSrc.ItemType.RawType, typeof(TDst)); 257Contracts.Assert(typeof(TSrc) == typeSrc.ItemType.RawType); 263var conv = Conversions.DefaultInstance.GetStandardConversion<TSrc, TDst>(typeSrc.ItemType, typeDst, out identity); 416var type = cursor.GetSlotType().ItemType;
Data\SchemaAnnotationsExtensions.cs (4)
16/// <c>SlotNames</c> annotation of a <see cref="VectorDataViewType"/> whose <see cref="VectorDataViewType.ItemType"/> 39/// <c>SlotNames</c> annotation of a <see cref="VectorDataViewType"/> whose <see cref="VectorDataViewType.ItemType"/> 62&& keyValueItemType.Equals(vectorType.ItemType); 67/// key values are of <see cref="VectorDataViewType.ItemType"/> whose <see cref="DataViewType.RawType"/> matches
DataLoadSave\Binary\Codecs.cs (2)
792Contracts.Assert(innerCodec.Type == type.ItemType); 1158DataViewType itemType = type.ItemType;
DataLoadSave\FakeSchema.cs (1)
37del = Utils.MarshalInvoke(_getDefaultVectorGetterMethodInfo, vectorType.ItemType.RawType);
DataLoadSave\Text\TextLoaderParser.cs (2)
706if (vectorType?.ItemType is KeyDataViewType vectorKeyType) 712DataViewType itemType = vectorType?.ItemType ?? info.ColType;
DataLoadSave\Text\TextSaver.cs (5)
67writePipeType = typeof(VecValueWriter<>).MakeGenericType(vectorType.ItemType.RawType); 162: base(type.ItemType, source, sep) 168&& typeNames.Size == type.Size && typeNames.ItemType is TextDataViewType) 423if (typeNames != null && typeNames.Size == vectorType.Size && typeNames.ItemType is TextDataViewType) 503DataViewType itemType = vectorType?.ItemType ?? type;
DataLoadSave\Transpose\TransposeLoader.cs (3)
315Host.CheckDecode(type.GetItemType().Equals(vectorType.ItemType)); 649DataViewType cursorType = ((ITransposeDataView)this).GetSlotType(col).ItemType; 805itemType = vectorType.ItemType;
DataView\CacheDataView.cs (1)
1290pipeType = typeof(ImplVec<>).MakeGenericType(vectorType.ItemType.RawType);
DataView\DataViewConstructionUtils.cs (8)
248Host.Assert(vectorType.ItemType is TextDataViewType); 254Host.Assert(Nullable.GetUnderlyingType(outputType.GetElementType()) == vectorType.ItemType.RawType); 256Host.Assert(outputType.GetElementType() == vectorType.ItemType.RawType); 266Host.Assert(outputType.GetGenericArguments()[0] == vectorType.ItemType.RawType); 268genericType = vectorType.ItemType.RawType; 900DataViewType annotationItemType = annotationVectorType?.ItemType ?? annotationType; 947Contracts.Assert(itemType == annotationVectorType.ItemType.RawType); 950return Utils.MarshalInvoke(_getVBufferGetterMethodInfo, this, annotationVectorType.ItemType.RawType) as ValueGetter<TDst>;
DataView\InternalSchemaDefinition.cs (1)
281DataViewType itemType = columnVectorType?.ItemType ?? col.ColumnType;
DataView\Transposer.cs (6)
244var type = ((ITransposeDataView)this).GetSlotType(col).ItemType.RawType; 272elementType = vectorDataViewType.ItemType; 1099Contracts.Assert(type.ItemType.RawType == typeof(T)); 1105_types[0] = new VectorDataViewType(type.ItemType, _lims[0]); 1107_types[c] = new VectorDataViewType(type.ItemType, _lims[c] - _lims[c - 1]); 1399return Utils.MarshalInvoke(_getRowCursorShimCoreMethodInfo, cursor.GetSlotType().ItemType.RawType, provider, cursor);
DataView\TypedCursor.cs (3)
145return colType is VectorDataViewType vectorType && vectorType.ItemType.RawType == itemType; 386Ch.Assert(fieldType.GetGenericArguments()[0] == vectorType.ItemType.RawType); 388genericType = vectorType.ItemType.RawType;
Evaluators\BinaryClassifierEvaluator.cs (1)
179vecType.Size > 0 && vecType.ItemType == TextDataViewType.Instance)
Evaluators\ClusteringEvaluator.cs (3)
108if (!(type is VectorDataViewType vectorType) || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single) 118if (!(t is VectorDataViewType vectorType) || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single) 756if (!(type is VectorDataViewType vectorType) || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single)
Evaluators\EvaluatorUtils.cs (12)
311&& vectorType.ItemType == NumberDataViewType.Double 354if (slotNamesType != null && slotNamesType.Size == size && slotNamesType.ItemType is TextDataViewType) 574DataViewType keyValueItemType = (keyValueType as VectorDataViewType)?.ItemType ?? keyValueType; 577DataViewType typeItemType = vectorType?.ItemType ?? type; 933idv = Utils.MarshalInvoke(AddVarLengthColumn<int>, vectorType.ItemType.RawType, env, idv, 987variableSizeVectorColumnName + "_VarLength", typeSrc, new VectorDataViewType((PrimitiveDataViewType)typeSrc.ItemType), 1017else if (type is VectorDataViewType vectorType && vectorType.ItemType == NumberDataViewType.Double) 1028if (slotNamesType != null && slotNamesType.Size == vectorType.Size && slotNamesType.ItemType is TextDataViewType) 1237if (keyValuesType == null || !(keyValuesType.ItemType is TextDataViewType) || 1280else if (type is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Double) 1394host.Assert(type != null && type.IsKnownSize && type.ItemType is TextDataViewType); 1479Contracts.Check(type != null && type.IsKnownSize && type.ItemType == NumberDataViewType.Double);
Evaluators\MulticlassClassificationEvaluator.cs (3)
79if (scoreType == null || scoreType.Size < 2 || scoreType.ItemType != NumberDataViewType.Single) 103if (mdType != null && mdType.IsKnownSize && mdType.ItemType is TextDataViewType) 861if (scoreType == null || scoreType.Size < 2 || scoreType.ItemType != NumberDataViewType.Single)
Evaluators\MultiOutputRegressionEvaluator.cs (9)
62if (t == null || !t.IsKnownSize || t.ItemType != NumberDataViewType.Single) 66if (t == null || !t.IsKnownSize || (t.ItemType != NumberDataViewType.Single && t.ItemType != NumberDataViewType.Double)) 550if (t == null || !t.IsKnownSize || (t.ItemType != NumberDataViewType.Single && t.ItemType != NumberDataViewType.Double)) 552labelType = new VectorDataViewType((PrimitiveDataViewType)t.ItemType, t.Size); 559if (t == null || !t.IsKnownSize || t.ItemType != NumberDataViewType.Single) 561scoreType = new VectorDataViewType((PrimitiveDataViewType)t.ItemType, t.Size); 708if (type != null && type.IsKnownSize && type.ItemType == NumberDataViewType.Double)
Evaluators\QuantileRegressionEvaluator.cs (9)
48Host.Check(type != null && type.IsKnownSize && type.ItemType is TextDataViewType, "Quantile regression score column must have slot names"); 60if (t == null || t.Size == 0 || (t.ItemType != NumberDataViewType.Single && t.ItemType != NumberDataViewType.Double)) 72Host.Assert(scoreType != null && scoreType.Size > 0 && (scoreType.ItemType == NumberDataViewType.Single || scoreType.ItemType == NumberDataViewType.Double)); 75if (slotNamesType != null && slotNamesType.Size == scoreType.Size && slotNamesType.ItemType is TextDataViewType) 452if (scoreType == null || scoreType.Size == 0 || (scoreType.ItemType != NumberDataViewType.Single && scoreType.ItemType != NumberDataViewType.Double)) 517if (type is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Double)
Model\Pfa\PfaUtils.cs (1)
165var itemType = PfaTypeOrNullCore(vectorType.ItemType);
Scorers\BinaryClassifierScorer.cs (1)
72return Utils.MarshalInvoke(WrapCore<int>, keyType.ItemType.RawType, env, mapper, trainSchema);
Scorers\ClusteringScorer.cs (1)
144&& vectorType.ItemType == NumberDataViewType.Single;
Scorers\MulticlassClassificationScorer.cs (8)
145_getter = Utils.MarshalInvoke(_decodeInitMethodInfo, this, _type.ItemType.RawType, value); 187Utils.MarshalActionInvoke(SaveCore<int>, _type.ItemType.RawType, ctx); 193Contracts.Assert(_type.ItemType.RawType == typeof(T)); 203throw _host.Except("We do not know how to serialize label names of type '{0}'", _type.ItemType); 235return Utils.MarshalInvoke(CreateBound<int>, _type.ItemType.RawType, env, (ISchemaBoundRowMapper)innerBound, _type, _getter, _metadataKind, _canWrap); 422return Utils.MarshalInvoke(WrapCore<int>, keyType.ItemType.RawType, env, mapper, trainSchema); 481return labelNameType is VectorDataViewType vectorType && vectorType.Size == scoreType.GetVectorSize() && vectorType.ItemType == TextDataViewType.Instance; 606scoreType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Single;
Scorers\SchemaBindablePredictorWrapper.cs (7)
136DataViewType typeItemType = typeVectorType?.ItemType ?? type; 137DataViewType typeInItemType = typeInVectorType?.ItemType ?? typeIn; 486Contracts.Check(distMapper.InputType is VectorDataViewType vectorType && vectorType.ItemType == NumberDataViewType.Single, 531&& vectorType.ItemType == NumberDataViewType.Single, 650&& vectorType.ItemType == NumberDataViewType.Single, 669&& vectorType.ItemType == NumberDataViewType.Single); 705Contracts.Assert(typeSrc != null && typeSrc.ItemType == NumberDataViewType.Single);
Training\TrainerUtils.cs (3)
57if (!(col.Type is VectorDataViewType vecType && vecType.Size > 0 && vecType.ItemType == NumberDataViewType.Single)) 75Contracts.Assert(colType.ItemType == NumberDataViewType.Single); 195&& vectorType.ItemType == NumberDataViewType.Single))
Transforms\ColumnConcatenatingTransformer.cs (5)
473DataViewType currentItemType = curVectorType?.ItemType ?? curType; 652if (typeNames != null && typeNames.Size == vectorTypeSrc.Size && typeNames.ItemType is TextDataViewType) 680return Utils.MarshalInvoke(_makeGetterMethodInfo, this, OutputType.ItemType.RawType, input); 824var itemColumnType = OutputType.ItemType; 948castNode.AddAttribute("to", outColType.ItemType.RawType);
Transforms\FeatureContributionCalculationTransformer.cs (1)
184if (_featureColumnType == null || _featureColumnType.ItemType != NumberDataViewType.Single)
Transforms\Hashing.cs (9)
404Host.Assert(HashingEstimator.IsColumnTypeValid(srcType.ItemType)); 406Type rawType = srcType.ItemType.RawType; 407if (srcType.ItemType is KeyDataViewType) 445Host.Assert(srcType.ItemType == TextDataViewType.Instance); 452Host.Assert(srcType.ItemType.RawType == typeof(T)); 471Type rawType = srcType.ItemType.RawType; 472if (srcType.ItemType is KeyDataViewType) 1351builder.AddKeyValues(_parent._kvTypes[i].Size, (PrimitiveDataViewType)_parent._kvTypes[i].ItemType, getter); 1515DataViewType itemType = vectorTypeSrc?.ItemType ?? typeSrc;
Transforms\InvertHashUtils.cs (2)
362ch.CheckDecode(vectorType.ItemType is TextDataViewType); 397ch.Assert(vectorType.ItemType == TextDataViewType.Instance);
Transforms\KeyToVector.cs (5)
316if (typeNames == null || !typeNames.IsKnownSize || !(typeNames.ItemType is TextDataViewType) || 380if (typeSlotSrc != null && typeSlotSrc.Size == typeSrc.Size && typeSlotSrc.ItemType is TextDataViewType) 388int keyCount = typeSrc.ItemType.GetKeyCountAsInt32(Host); 507KeyDataViewType keyTypeSrc = srcVectorType.ItemType as KeyDataViewType; 553KeyDataViewType keyTypeSrc = srcVectorType.ItemType as KeyDataViewType;
Transforms\NAFilter.cs (2)
190var itemType = (type as VectorDataViewType)?.ItemType ?? type; 281genericArgument = vecType.ItemType.RawType;
Transforms\NormalizeColumn.cs (28)
206itemType = vectorType.ItemType; 440else if (typeSrc is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 442if (vectorType.ItemType == NumberDataViewType.Single) 444if (vectorType.ItemType == NumberDataViewType.Double) 559else if (typeSrc is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 561if (vectorType.ItemType == NumberDataViewType.Single) 563if (vectorType.ItemType == NumberDataViewType.Double) 695if (typeSrc is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 697if (vectorType.ItemType == NumberDataViewType.Single) 699if (vectorType.ItemType == NumberDataViewType.Double) 990if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 992if (vectorType.ItemType == NumberDataViewType.Single) 994if (vectorType.ItemType == NumberDataViewType.Double) 1029if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1031if (vectorType.ItemType == NumberDataViewType.Single) 1033if (vectorType.ItemType == NumberDataViewType.Double) 1070if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1072if (vectorType.ItemType == NumberDataViewType.Single) 1074if (vectorType.ItemType == NumberDataViewType.Double) 1110if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1112if (vectorType.ItemType == NumberDataViewType.Single) 1114if (vectorType.ItemType == NumberDataViewType.Double) 1169if (srcType is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 1171if (vectorType.ItemType == NumberDataViewType.Single) 1173if (vectorType.ItemType == NumberDataViewType.Double) 1221if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1223if (vectorType.ItemType == NumberDataViewType.Single) 1225if (vectorType.ItemType == NumberDataViewType.Double)
Transforms\NormalizeColumnDbl.cs (3)
731host.Check(typeSrc.ItemType.RawType == typeof(TFloat), "The column type must be vector of Double."); 1057host.Check(typeSrc.ItemType.RawType == typeof(TFloat), "The column type must be vector of Double."); 1260host.Check(typeSrc.ItemType.RawType == typeof(TFloat), "The column type must be vector of Double.");
Transforms\NormalizeColumnSng.cs (3)
888host.Check(typeSrc.ItemType.RawType == typeof(TFloat), "The column type must be vector of Single."); 1217host.Check(typeSrc.ItemType.RawType == typeof(TFloat), "The column type must be vector of Single."); 1421host.Check(typeSrc.ItemType.RawType == typeof(TFloat), "The column type must be vector of Single.");
Transforms\Normalizer.cs (2)
475DataViewType itemType = vectorType?.ItemType ?? type; 709DataViewType itemType = vectorType?.ItemType ?? colType;
Transforms\RowShufflingTransformer.cs (1)
380pipeType = typeof(ImplVec<>).MakeGenericType(vectorType.ItemType.RawType);
Transforms\SlotsDroppingTransformer.cs (5)
487var rawType = srcVectorType?.ItemType ?? _srcTypes[i]; 545type = new VectorDataViewType(vectorType.ItemType, Math.Max(dstLength, 1)); 766return Utils.MarshalInvoke(_makeVecTrivialGetterMethodInfo, this, vectorType.ItemType.RawType); 787return Utils.MarshalInvoke(_makeVecGetterMethodInfo, this, vectorType.ItemType.RawType, input, iinfo); 841var type = new VectorDataViewType(vectorType.ItemType, Math.Max(dstLength, 1));
Transforms\TransformBase.cs (4)
286Contracts.Assert(slotTypeSrc == null || typeSrc.GetItemType().Equals(slotTypeSrc.ItemType)); 941if (type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType) 955if (type is VectorDataViewType vectorType && vectorType.ItemType == NumberDataViewType.Single) 965&& vectorType.ItemType == NumberDataViewType.Single)
Transforms\TypeConverting.cs (1)
474return RowCursorUtils.GetVecGetterAs(vectorType.ItemType, input, _srcCols[iinfo]);
Transforms\ValueMapping.cs (1)
901return Utils.MarshalInvoke(_getVectorMethodInfo, vectorType.ItemType.RawType, _mapping[key]);
Transforms\ValueToKeyMappingTransformer.cs (2)
221DataViewType itemType = vectorType?.ItemType ?? type; 962DataViewType itemType = vectorType?.ItemType ?? info.TypeSrc;
Transforms\ValueToKeyMappingTransformerImpl.cs (4)
1100TypedMap.ItemType.GetKeyCountAsInt32(_host) == 0 || !Utils.MarshalInvoke(_addMetadataCoreMethodInfo, this, srcMetaType.ItemType.RawType, srcMetaType.ItemType, builder)) 1181TypedMap.ItemType.GetKeyCountAsInt32(_host) == 0 || !Utils.MarshalInvoke(_writeTextTermsCoreMethodInfo, this, srcMetaType.ItemType.RawType, srcMetaType.ItemType, writer))
Utilities\ColumnCursor.cs (3)
76if (elementType == colVectorType.ItemType.RawType) 83else if (elementType == typeof(string) && colVectorType.ItemType is TextDataViewType) 88var meth = del.Method.GetGenericMethodDefinition().MakeGenericMethod(elementType, colVectorType.ItemType.RawType);
Microsoft.ML.DataView (5)
VectorType.cs (5)
16/// where the type parameter is in <see cref="ItemType"/>. 127if (!ItemType.Equals(tmp.ItemType)) 148int hash = Hashing.CombineHash(ItemType.GetHashCode(), Size); 158sb.Append("Vector<").Append(ItemType);
Microsoft.ML.Ensemble (7)
OutputCombiners\BaseStacking.cs (1)
117if (!(ivm.InputType is VectorDataViewType vectorType) || vectorType.ItemType != NumberDataViewType.Single)
PipelineEnsemble.cs (2)
612return Utils.MarshalInvoke(CheckKeyLabelColumnCore<int>, mdType.ItemType.RawType, env, models, (KeyDataViewType)labelType, schema, labelCol.Index, mdType); 648env.Assert(keyValuesType.ItemType.RawType == typeof(T));
Trainer\EnsembleDistributionModelParameters.cs (1)
108&& mapper.InputType is VectorDataViewType inVectorType && inVectorType.ItemType == NumberDataViewType.Single
Trainer\EnsembleModelParameters.cs (1)
99&& mapper.InputType is VectorDataViewType inputVectorType && inputVectorType.ItemType == NumberDataViewType.Single
Trainer\Multiclass\EnsembleMulticlassModelParameters.cs (2)
158&& mapper.InputType is VectorDataViewType inVectorType && inVectorType.ItemType == NumberDataViewType.Single 160&& outVectorType.Size > 0 && outVectorType.ItemType == NumberDataViewType.Single)
Microsoft.ML.EntryPoints (2)
FeatureCombiner.cs (1)
124if (type == null || !type.IsKnownSize || !(type.ItemType is TextDataViewType))
PermutationFeatureImportance.cs (1)
324var type = ((VectorDataViewType)schema[metricName].ColumnType).ItemType;
Microsoft.ML.ImageAnalytics (1)
VectorToImageTransform.cs (1)
307throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputColName, new VectorDataViewType(vectorType.ItemType, _columns[col].ImageHeight, _columns[col].ImageWidth, _columns[col].Planes).ToString(), vectorType.ToString());
Microsoft.ML.Mkl.Components (2)
OlsLinearRegression.cs (1)
169if (typeFeat.ItemType != NumberDataViewType.Single)
VectorWhitening.cs (1)
223DataViewType itemType = vectorType?.ItemType ?? type;
Microsoft.ML.OnnxConverter (1)
OnnxUtils.cs (1)
347rawType = vectorType.ItemType.RawType;
Microsoft.ML.OnnxTransformer (5)
OnnxTransform.cs (3)
626var elemRawType = vectorType.ItemType.RawType; 628if (vectorType.ItemType is TextDataViewType) 1078var expectedType = ((VectorDataViewType)inputNodeInfo.DataViewType).ItemType;
OnnxUtils.cs (2)
327dataViewType = new VectorDataViewType(vectorType.ItemType, shapeDictionary[name]); 329dataViewType = new VectorDataViewType(vectorType.ItemType);
Microsoft.ML.PCA (1)
PcaTransformer.cs (1)
511if (!(type is VectorDataViewType vectorType && vectorType.Size > 1 && vectorType.ItemType.Equals(NumberDataViewType.Single)))
Microsoft.ML.Predictor.Tests (2)
TestTransposer.cs (2)
29var itemType = vecType?.ItemType ?? type; 78Assert.True(typeof(T) == type.ItemType.RawType, $"{desc} had wrong type for slot cursor");
Microsoft.ML.Samples (3)
Dynamic\DataOperations\LoadFromEnumerable.cs (1)
76.ItemType;
Dynamic\TensorFlow\TextClassification.cs (2)
68featuresType.ItemType.RawType, featuresType.Dimensions[0]); 73"Prediction/Softmax", predictionType.ItemType.RawType,
Microsoft.ML.Samples.GPU (2)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (2)
68featuresType.ItemType.RawType, featuresType.Dimensions[0]); 73"Prediction/Softmax", predictionType.ItemType.RawType,
Microsoft.ML.StandardTrainers (4)
FactorizationMachine\FactorizationMachineTrainer.cs (1)
425vectorType.ItemType != NumberDataViewType.Single)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
183if (!(labelMetadataType is VectorDataViewType vecType && vecType.ItemType == TextDataViewType.Instance && vecType.Size == _numClasses))
Standard\MulticlassClassification\OneVersusAllTrainer.cs (1)
522if (!(mapper.InputType is VectorDataViewType mapperVectorType) || mapperVectorType.ItemType != NumberDataViewType.Single)
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (1)
332if (vectorType == null || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single)
Microsoft.ML.TestFramework (1)
DataPipe\TestDataPipeBase.cs (1)
935Type itemType = vectorType.ItemType.RawType;
Microsoft.ML.TestFrameworkCommon (3)
TestCommon.cs (3)
221if (!vectorType.ItemType.Equals(otherVectorType.ItemType)) 287private static DataViewType GetItemType(this DataViewType columnType) => (columnType as VectorDataViewType)?.ItemType ?? columnType;
Microsoft.ML.Tests (12)
Scenarios\Api\TestApi.cs (1)
239Assert.True(idv.Schema[1].Annotations.Schema[0].Type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType);
TermEstimatorTests.cs (1)
147var itemType1 = (type1 as VectorDataViewType)?.ItemType ?? type1;
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (3)
63Assert.Equal(NumberDataViewType.Single, treeValuesType.ItemType); 81Assert.Equal(NumberDataViewType.Single, treeLeafIdsType.ItemType); 104Assert.Equal(NumberDataViewType.Single, treePathIdsType.ItemType);
Transformers\ConcatTests.cs (6)
75Assert.True(t is VectorDataViewType vt1 && vt1.ItemType == NumberDataViewType.Single && vt1.Size == 1); 77Assert.True(t is VectorDataViewType vt2 && vt2.ItemType == NumberDataViewType.Single && vt2.Size == 2); 79Assert.True(t is VectorDataViewType vt3 && vt3.ItemType == NumberDataViewType.Single && vt3.Size == 5); 81Assert.True(t is VectorDataViewType vt4 && vt4.ItemType == NumberDataViewType.Single && vt4.Size == 0); 143Assert.True(t is VectorDataViewType vt2 && vt2.ItemType == NumberDataViewType.Single && vt2.Size == 2); 145Assert.True(t is VectorDataViewType vt3 && vt3.ItemType == NumberDataViewType.Single && vt3.Size == 5);
Transformers\CopyColumnEstimatorTests.cs (1)
148var itemType1 = (type1 as VectorDataViewType)?.ItemType ?? type1;
Microsoft.ML.TorchSharp (12)
AutoFormerV2\ObjectDetectionTrainer.cs (4)
626Microsoft.ML.Internal.Utilities.Utils.MarshalActionInvoke(SaveLabelValues<int>, labelColType.ItemType.RawType, ctx); 644throw Host.Except("We do not know how to serialize label names of type '{0}'", labelColType.ItemType); 701var labelGetter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_decodeInitMethodInfo, vecType.ItemType.RawType, value); 756var getter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_makeLabelAnnotationGetter, this, keyType.ItemType.RawType, _parent.LabelColumn);
NasBert\NasBertTrainer.cs (2)
521var getter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_makeLabelAnnotationGetter, this, keyType.ItemType.RawType, Parent.LabelColumn); 543var getter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_makeLabelAnnotationGetter, this, keyType.ItemType.RawType, Parent.LabelColumn);
NasBert\NerTrainer.cs (3)
282Microsoft.ML.Internal.Utilities.Utils.MarshalActionInvoke(SaveLabelValues<int>, labelColType.ItemType.RawType, ctx); 295throw Host.Except("We do not know how to serialize label names of type '{0}'", labelColType.ItemType); 347var labelGetter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_decodeInitMethodInfo, vecType.ItemType.RawType, value);
NasBert\TextClassificationTrainer.cs (3)
218Microsoft.ML.Internal.Utilities.Utils.MarshalActionInvoke(SaveLabelValues<int>, labelColType.ItemType.RawType, ctx); 231throw Host.Except("We do not know how to serialize label names of type '{0}'", labelColType.ItemType); 283var labelGetter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_decodeInitMethodInfo, vecType.ItemType.RawType, value);
Microsoft.ML.Transforms (40)
CountFeatureSelection.cs (3)
367var methodInfo = del.GetMethodInfo().GetGenericMethodDefinition().MakeGenericMethod(colType.ItemType.RawType); 413_isDefault = Data.Conversion.Conversions.DefaultInstance.GetIsDefaultPredicate<T>(type.ItemType); 414if (!Data.Conversion.Conversions.DefaultInstance.TryGetIsNAPredicate<T>(type.ItemType, out _isMissing))
GcnTransform.cs (1)
894return vectorType.ItemType == NumberDataViewType.Single;
HashJoiningTransform.cs (1)
486itemType = vectorType.ItemType;
KeyToVectorMapping.cs (3)
229if (typeNames == null || !typeNames.IsKnownSize || !(typeNames.ItemType is TextDataViewType) || 296if (typeSlotSrc != null && typeSlotSrc.Size == srcVectorSize && typeSlotSrc.ItemType is TextDataViewType) 385Host.Assert(typeSrc.ItemType is KeyDataViewType);
MissingValueIndicatorTransform.cs (2)
152!(typeNames.ItemType is TextDataViewType)) 200if (typeNames == null || typeNames.Size != srcVectorType.Size || !(typeNames.ItemType is TextDataViewType))
MissingValueIndicatorTransformer.cs (1)
469Type rawType = (inputType is VectorDataViewType vectorType) ? vectorType.ItemType.RawType : inputType.RawType;
MissingValueReplacing.cs (6)
243var meth = func.GetMethodInfo().GetGenericMethodDefinition().MakeGenericMethod(savedVectorType.ItemType.RawType); 258InPredicate<T> defaultPred = Data.Conversion.Conversions.DefaultInstance.GetIsDefaultPredicate<T>(srcType.ItemType); 295type = new VectorDataViewType(vectorType.ItemType, vectorType.Dimensions); 569vectorType = new VectorDataViewType(vectorType.ItemType, vectorType.Dimensions); 878rawType = vectorType.ItemType.RawType; 1052new VectorDataViewType(vectorType.ItemType, vectorType.Dimensions);
MissingValueReplacingUtils.cs (12)
54if (vectorType.ItemType.RawType == typeof(float)) 56else if (vectorType.ItemType.RawType == typeof(double)) 61if (vectorType.ItemType.RawType == typeof(float)) 63else if (vectorType.ItemType.RawType == typeof(double)) 68if (vectorType.ItemType.RawType == typeof(float)) 70else if (vectorType.ItemType.RawType == typeof(double)) 79if (vectorType.ItemType.RawType == typeof(float)) 81else if (vectorType.ItemType.RawType == typeof(double)) 86if (vectorType.ItemType.RawType == typeof(float)) 88else if (vectorType.ItemType.RawType == typeof(double)) 93if (vectorType.ItemType.RawType == typeof(float)) 95else if (vectorType.ItemType.RawType == typeof(double))
OptionalColumnTransform.cs (2)
413return Utils.MarshalInvoke(_makeGetterVecMethodInfo, this, vectorType.ItemType.RawType, vectorType.Size); 501return Utils.MarshalInvoke(_makeGetterVecMethodInfo, this, vectorType.ItemType.RawType, vectorType.Size);
RandomFourierFeaturizing.cs (1)
231if (type is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Single)
Text\LdaTransform.cs (2)
580if (srcType == null || !srcType.IsKnownSize || !(srcType.ItemType is NumberDataViewType)) 842if (srcColType == null || !srcColType.IsKnownSize || !(srcColType.ItemType is NumberDataViewType))
Text\NgramHashingTransformer.cs (1)
1186if (!(vectorType.ItemType is KeyDataViewType itemKeyType))
Text\NgramTransform.cs (2)
245env.Assert(srcTypes[iinfo] is VectorDataViewType vectorType && vectorType.ItemType is KeyDataViewType); 962if (!(vectorType.ItemType is KeyDataViewType itemKeyType))
Text\StopWordsRemovingTransformer.cs (1)
631type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType;
Text\WordEmbeddingsExtractor.cs (1)
304if (!(colType is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType))
UngroupTransform.cs (1)
339infos[i] = new PivotColumnOptions(name, col, colType.Size, colType.ItemType);