InferencingOptionsPreview.MinimizeMemoryAllocation 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
已取代。 取得或設定是否要在模型評估之後最小化記憶體配置。
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 命名空間。