次の方法で共有


TensorVariableDescriptorPreview.ModelFeatureKind プロパティ

定義

非推奨になりました。 変数のデータ型を取得します。

public:
 property LearningModelFeatureKindPreview ModelFeatureKind { LearningModelFeatureKindPreview get(); };
LearningModelFeatureKindPreview ModelFeatureKind();
/// [get: Windows.Foundation.Metadata.Deprecated("Use ILearningModelFeatureDescriptor instead of ILearningModelVariableDescriptorPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
LearningModelFeatureKindPreview ModelFeatureKind();
public LearningModelFeatureKindPreview ModelFeatureKind { get; }
public LearningModelFeatureKindPreview ModelFeatureKind { [Windows.Foundation.Metadata.Deprecated("Use ILearningModelFeatureDescriptor instead of ILearningModelVariableDescriptorPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")] get; }
var learningModelFeatureKindPreview = tensorVariableDescriptorPreview.modelFeatureKind;
Public ReadOnly Property ModelFeatureKind As LearningModelFeatureKindPreview

プロパティ値

変数のデータ型。

実装

属性

public void Evaluator(LearningModelPreview model)
{
	// Retrieve the first input feature which is a Tensor
    ILearningModelVariableDescriptorPreview inputTensorFeatureDescription = model.Description.InputFeatures.First(feature=>feature.ModelFeatureKind == LearningModelFeatureKindPreview.Tensor);

    TensorVariableDescriptorPreview TensorDescriptor = (TensorVariableDescriptorPreview)inputTensorFeatureDescription;

	// Ensure the input feature is of type Tensor
    if (TensorDescriptor.ModelFeatureKind != LearningModelFeatureKindPreview.Tensor)
    {
        Console.WriteLine($"Input Feature Name: {TensorDescriptor.Name}. Feature type is not a Tensor.");
    }

 }

注釈

警告

これは非推奨の API です。 代わりに、 Windows.AI.MachineLearning 名前空間を 使用してください。

適用対象