共用方式為


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 命名空間。

適用於