biasAdd function

VARP biasAdd(
  1. VARP x,
  2. VARP y
)

Adds bias to value.

This is (mostly) a special case of add where bias is restricted to 1-D. Broadcasting is supported, so value may have any number of dimensions. Unlike add, the type of bias is allowed to differ from value in the case where both types are quantized.

Args:

  • value: A variable with type Halide_Type_Float, Halide_Type_Int
  • bias: A 1-D variable with size matching the channel dimension of value. Must be the same type as value unless value is a quantized type, in which case a different quantized type may be used.

Returns:

  • A variable with the same type as value.

Implementation

VARP biasAdd(VARP x, VARP y) => VARP.fromPointer(C.mnn_expr_BiasAdd(x.ptr, y.ptr));