ILearningModelVariableDescriptorPreview.Name 属性

定义

已弃用。 获取变量名。

public:
 property Platform::String ^ Name { Platform::String ^ get(); };
winrt::hstring Name();
/// [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")]
winrt::hstring Name();
public string Name { get; }
public string Name { [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 string = iLearningModelVariableDescriptorPreview.name;
Public ReadOnly Property Name As String

属性值

String

Platform::String

winrt::hstring

变量的名称。

属性

示例

public void Evaluator(LearningModelPreview model)
{
	// Retrieve the first input feature which is an image
    ILearningModelVariableDescriptorPreview inputImageFeatureDescription = model.Description.InputFeatures.FirstOrDefault(feature=>feature.ModelFeatureKind == LearningModelFeatureKindPreview.Image);

    ImageVariableDescriptorPreview imageDescriptor = (ImageVariableDescriptorPreview)inputImageFeatureDescription;

	// Ensure the input feature has the specified name "data"
    if (imageDescriptor.Name == "data")
    {
        Console.WriteLine($"Verified. Input variable name is: {imageDescriptor.Name}");
    }
 }

注解

警告

这是一个已弃用的 API。 请改用 Windows.AI.MachineLearning 命名空间。

名称在模型中的所有其他变量中必须是唯一的。

适用于