affine

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

Compute the affine transformation along the given axes.

\[y = Wx + b \]

The range of axes is defined as:

\[[\text{Axis}, \text{Axis} + \text{NumAxes}) \]

Set axis to specific the start axis.

Set num_axes to -1 will scale all remained axes.

Parameters:
  • inputs (Sequence[dragon.Tensor]) – The x, W and b.
  • axis (int, optional, default=1) – The start axis, can be negative.
  • num_axes (int, optional, default=1) – The number of axes to compute.
Returns:

dragon.Tensor – The y.