ScriptIntrinsicBLAS.BNNM 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用输入偏移量和输出缩放为神经网络执行 8 位矩阵乘法。 最终输出以 1.10.21 固定点格式计算,然后删除其小数位。
[Android.Runtime.Register("BNNM", "(Landroid/renderscript/Allocation;ILandroid/renderscript/Allocation;ILandroid/renderscript/Allocation;II)V", "", ApiSince=23)]
public void BNNM(Android.Renderscripts.Allocation? A, int a_offset, Android.Renderscripts.Allocation? B, int b_offset, Android.Renderscripts.Allocation? C, int c_offset, int c_mult);
[<Android.Runtime.Register("BNNM", "(Landroid/renderscript/Allocation;ILandroid/renderscript/Allocation;ILandroid/renderscript/Allocation;II)V", "", ApiSince=23)>]
member this.BNNM : Android.Renderscripts.Allocation * int * Android.Renderscripts.Allocation * int * Android.Renderscripts.Allocation * int * int -> unit
参数
输入分配包含矩阵 A,支持的元素类型 Element#U8。
- a_offset
- Int32
矩阵 A 中所有值的偏移量,例如 A[i,j] = A[i,j] - a_offset。 值应从 0 到 255。
输入分配包含矩阵 B,支持的元素类型 Element#U8。
- b_offset
- Int32
矩阵 B 中所有值的偏移量,例如 B[i,j] = B[i,j] - b_offset。 值应从 0 到 255。
矩阵 C 的输出分配,具有元素类型 Element#U8。
- c_offset
- Int32
矩阵 C 中所有值的偏移量。
- c_mult
- Int32
输出偏移量后应用的固定点乘数。
- 特性
注解
神经网络的 8 位 GEMM 类操作使用 A 和 B 转置,输入偏移量和输出缩放。 计算是在最终输出的 1.10.21 定点格式中完成的,就在有下移时删除小数部分之前。 输出值被限制为 0 到 255 以适应字节,但 10 位格式会提供一些前厅,以避免在小溢出时四处环绕。
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。