channel_affine

dragon.channel_affine(
  inputs,
  axis=1,
  num_axes=1,
  **kwargs
)[source]

Apply affine transformation along the channels.

\[\text{out} = \text{weight} * \text{input} + \text{bias} \]

The range of channels to transform is given by:

\[[\text{axis}, \text{axis} + \text{num\_axes}) \]

Set axis to specific the start axis.

Set num_axes to -1 will transform all remained axes.

Parameters:
  • inputs (Sequence[dragon.Tensor]) – The input, weight and optional bias tensor.
  • axis (int, optional, default=1) – The start axis, can be negative.
  • num_axes (int, optional, default=1) – The number of axes to transform.
Returns:

dragon.Tensor – The output tensor.