InferencingOptionsPreview.MinimizeMemoryAllocation 属性

定义

已弃用。 获取或设置是否在模型评估后最小化内存分配。

public:
 property bool MinimizeMemoryAllocation { bool get(); void set(bool value); };
bool MinimizeMemoryAllocation();

void MinimizeMemoryAllocation(bool value);
/// [get: Windows.Foundation.Metadata.Deprecated("Use LearningModel instead of IInferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
/// [set: Windows.Foundation.Metadata.Deprecated("Use LearningModel instead of IInferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
bool MinimizeMemoryAllocation();

void MinimizeMemoryAllocation(bool value);
public bool MinimizeMemoryAllocation { get; set; }
public bool MinimizeMemoryAllocation { [Windows.Foundation.Metadata.Deprecated("Use LearningModel instead of IInferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")] get; [Windows.Foundation.Metadata.Deprecated("Use LearningModel instead of IInferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")] set; }
var boolean = inferencingOptionsPreview.minimizeMemoryAllocation;
inferencingOptionsPreview.minimizeMemoryAllocation = boolean;
Public Property MinimizeMemoryAllocation As Boolean

属性值

Boolean

bool

如果在评估期间最小化内存分配,则为 True;否则为 false。 默认值为 false。

属性

示例

public void SetEvaluationOptionsForModel(LearningModelPreview model)
{
    InferencingOptionsPreview options = model.InferencingOptions;
    options.MinimizeMemoryAllocation = true;

    model.InferencingOptions = options;
}

注解

警告

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

适用于