Compartir a través de


ILearningModelVariableDescriptorPreview.IsRequired Propiedad

Definición

En desuso. Obtiene si la variable es necesaria o opcional.

public:
 property bool IsRequired { bool get(); };
bool IsRequired();
/// [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")]
bool IsRequired();
public bool IsRequired { get; }
public bool IsRequired { [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 boolean = iLearningModelVariableDescriptorPreview.isRequired;
Public ReadOnly Property IsRequired As Boolean

Valor de propiedad

Boolean

bool

True si se requiere la variable; de lo contrario, false.

Atributos

Ejemplos

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;

	//Verify if the input feature is required or optional.
    if (imageDescriptor.IsRequired == true)
    {
        Console.WriteLine($"Input Feature Name: {imageDescriptor.Name} is required.");
    }
 }

Comentarios

Advertencia

Se trata de una API en desuso. Use el espacio de nombres Windows.AI.MachineLearning en su lugar.

Se aplica a