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