語言

InferenceInput.ExpectedOutputStructure 屬性

定義

空的 InferenceOutput 代表預期的輸出結構。

public Android.AdServices.OnDevicePersonalization.InferenceOutput ExpectedOutputStructure { [Android.Runtime.Register("getExpectedOutputStructure", "()Landroid/adservices/ondevicepersonalization/InferenceOutput;", "", ApiSince=35)] get; }
[<get: Android.Runtime.Register("getExpectedOutputStructure", "()Landroid/adservices/ondevicepersonalization/InferenceOutput;", "", ApiSince=35)>]
member this.ExpectedOutputStructure : Android.AdServices.OnDevicePersonalization.InferenceOutput

屬性值

屬性

備註

空的 InferenceOutput 代表預期的輸出結構。 對於 LiteRT,推論程式碼會驗證此預期輸出結構是否與模型輸出簽名相符。

如果模型產生弦張量:

{@code
            String[] output = new String[3][2];  // Output tensor shape is [3, 2].
            HashMap<Integer, Object> outputs = new HashMap<>();
            outputs.put(0, output);
            expectedOutputStructure = new InferenceOutput.Builder().setDataOutputs(outputs).build();
            }

Java 文件 android.adservices.ondevicepersonalization.InferenceInput.getExpectedOutputStructure()。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於