LearningModelBindingPreview.Bind 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Bind(String, Object) |
已取代。 將單一輸入或輸出功能系結至定義的變數。 |
Bind(String, Object, IPropertySet) |
已取代。 使用指定的中繼資料,將單一輸入或輸出功能系結至已定義的變數。 |
Bind(String, Object)
已取代。 將單一輸入或輸出功能系結至定義的變數。
public:
virtual void Bind(Platform::String ^ name, Platform::Object ^ value) = Bind;
/// [Windows.Foundation.Metadata.Overload("Bind")]
void Bind(winrt::hstring const& name, IInspectable const& value);
/// [Windows.Foundation.Metadata.Overload("Bind")]
/// [Windows.Foundation.Metadata.Deprecated("Use ILearningModelBinding instead of ILearningModelBindingPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
void Bind(winrt::hstring const& name, IInspectable const& value);
[Windows.Foundation.Metadata.Overload("Bind")]
public void Bind(string name, object value);
[Windows.Foundation.Metadata.Overload("Bind")]
[Windows.Foundation.Metadata.Deprecated("Use ILearningModelBinding instead of ILearningModelBindingPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
public void Bind(string name, object value);
function bind(name, value)
Public Sub Bind (name As String, value As Object)
參數
- name
-
String
Platform::String
winrt::hstring
輸入/輸出功能的名稱。
- value
-
Object
Platform::Object
IInspectable
輸入/輸出功能的值。
- 屬性
範例
public void PrepareBinding(LearningModelPreview model, VideoFrame picture)
{
ImageVariableDescriptorPreview inputImageDescription;
List<ILearningModelVariableDescriptorPreview> inputFeatures = model.Description.InputFeatures.ToList();
inputImageDescription =
inputFeatures.FirstOrDefault(feature => feature.ModelFeatureKind == LearningModelFeatureKindPreview.Image)
as ImageVariableDescriptorPreview;
// Bind the image
var binding = new LearningModelBindingPreview(model);
binding.Bind(inputImageDescription, picture);
}
備註
注意:目前不支援 類型的 double
輸出。 可能的話,請考慮改用 類型 float
。
警告
這是已被取代的 API。 請改用 Windows.AI.MachineLearning 命名空間。
適用於
Bind(String, Object, IPropertySet)
已取代。 使用指定的中繼資料,將單一輸入或輸出功能系結至已定義的變數。
public:
virtual void Bind(Platform::String ^ name, Platform::Object ^ value, IPropertySet ^ metadata) = Bind;
/// [Windows.Foundation.Metadata.Overload("BindWithProperties")]
void Bind(winrt::hstring const& name, IInspectable const& value, IPropertySet const& metadata);
/// [Windows.Foundation.Metadata.Overload("BindWithProperties")]
/// [Windows.Foundation.Metadata.Deprecated("Use ILearningModelBinding instead of ILearningModelBindingPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
void Bind(winrt::hstring const& name, IInspectable const& value, IPropertySet const& metadata);
[Windows.Foundation.Metadata.Overload("BindWithProperties")]
public void Bind(string name, object value, IPropertySet metadata);
[Windows.Foundation.Metadata.Overload("BindWithProperties")]
[Windows.Foundation.Metadata.Deprecated("Use ILearningModelBinding instead of ILearningModelBindingPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
public void Bind(string name, object value, IPropertySet metadata);
function bind(name, value, metadata)
Public Sub Bind (name As String, value As Object, metadata As IPropertySet)
參數
- name
-
String
Platform::String
winrt::hstring
輸入/輸出功能的名稱。
- value
-
Object
Platform::Object
IInspectable
輸入/輸出功能的值。
- metadata
- IPropertySet
輸入/輸出功能的指定中繼資料。
- 屬性
備註
注意:目前不支援 類型的 double
輸出。 可能的話,請考慮改用 類型 float
。
警告
這是已被取代的 API。 請改用 Windows.AI.MachineLearning 命名空間。