bias_add

dragon.nn.bias_add(
  inputs,
  data_format='NCHW',
  inplace=False,
  **kwargs
)[source]

Add the bias across channels to input.

Examples:

x = dragon.ones((1, 2, 3, 3))
bias = dragon.ones((2,))
print(dragon.nn.bias_add([x, bias]))
Parameters:
  • inputs (Sequence[dragon.Tensor]) – The x and bias.
  • data_format (str, optional, default='NCHW') – 'NCHW' or 'NHWC'.
Returns:

dragon.Tensor – The output tensor.